Azure / Azure/azure-functions-host
The grace period for timeouts should be configurable
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
The grace period (that we get from WebJobs) for timeouts should be configurable.
The current [timeout grace period](https://github.com/Azure/azure-functions-host/blob/7971944540d259e7e3ebedd45a775efd353a5f70/src/WebJobs.Script.WebHost/WebScriptHostExceptionHandler.cs#L36) we use when `OnTimeoutExceptionAsync` is triggered is set to two seconds, with the incoming support for out-of-proc invocation cancellation, we should enable the `timeoutGracePeriod` value to be configurable.
Code changes will need to occur in the host and the [WebJobs extension repo](https://github.com/Azure/azure-webjobs-sdk-extensions).
- The GracePeriod property is defined in the [JobHostFunctionsTimeoutOptions](https://github.com/Azure/azure-webjobs-sdk/blob/46514f23a5b5f3cc885d97a5c634f7f80e92a42e/src/Microsoft.Azure.WebJobs.Host/Config/JobHostFunctionTimeoutOptions.cs#L35) class
- The host defines it's timeout options [here](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script/Config/JobHostFunctionTimeoutOptionsSetup.cs) and then the host dependency injects that options class [here](https://github.com/Azure/azure-functions-host/blob/7971944540d259e7e3ebedd45a775efd353a5f70/src/WebJobs.Script/ScriptHostBuilderExtensions.cs#L271)
- The `Configure()` method is called from [ScriptHostBuilderExtensions](https://github.com/Azure/azure-functions-host/blob/7971944540d259e7e3ebedd45a775efd353a5f70/src/WebJobs.Script/ScriptHostBuilderExtensions.cs#L415)
Contributor guide
Research direction
Start by reading JobHostFunctionTimeoutOptions.cs, JobHostFunctionTimeoutOptionsSetup.cs, and the Configure() and dependency-injection points in ScriptHostBuilderExtensions.cs, then compare the related WebJobs extension code. Done means the timeoutGracePeriod value can be configured and is used by the host when OnTimeoutExceptionAsync is triggered, with corresponding changes in both repositories.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100