Skip to content

Make FunctionStartTimeoutInSeconds (and related HTTP-coordinator time-outs) configurable #3100

@koudaiii

Description

@koudaiii

Description

Why

Please make time-out parameters such as FunctionStartTimeoutInSeconds configurable so that functions can run in environments where longer startup delays are acceptable.

What

The FunctionStartTimeoutInSeconds is hard-coded to 15 seconds, and the same applies to HttpContextTimeoutInSeconds and FunctionContextTimeoutInSeconds.
If startup might exceed these fixed values due to factors like resource constraints or machine specifications, then these constants may be too strict for environments where longer wait times are acceptable.

The following constants are hard-coded:

        private const int HttpContextTimeoutInSeconds = 5;
        private const int FunctionContextTimeoutInSeconds = 5;
        private const int FunctionStartTimeoutInSeconds = 15;

If the FunctionStartTimeoutInSeconds limit is exceeded, the function fails with a timeout error.

An example message is as follows:

Timed out waiting for the function start call. Invocation: '{invocationId}'. ref

_ = await contextRef.FunctionStartTask.Task.WaitAsync(TimeSpan.FromSeconds(FunctionStartTimeoutInSeconds));

Here is a sample log from a real occurrence:

Timestamp : 5/1/2025 9:06:54 AM
Inner Exception Type: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException
Total Occurrences: 18
Latest Exception Message: Result
/Failure Exception
/Timed out waiting for the function start call. Invocation
/'2ff4f8fd-19ad-4bf9-b5bf-11cf141fe334'.
/
Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.DefaultHttpCoordinator.SetFunctionContextAsync(String invocationId, FunctionContext context) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\Coordinator\DefaultHttpCoordinator.cs:line 67
Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 45
... (stack trace truncated) ...

I would like to request that time-out parameters such as FunctionStartTimeoutInSeconds be made configurable—within reasonable upper and lower bounds—so that they can accommodate environments where longer wait times are acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: httpItems related to experience improvements for HTTP triggersenhancementNew feature or requestneeds-discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions