Azure / Azure/azure-functions-host
Host should handle client disconnects received in FrontEnd when Functions are executing
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### Investigative information
Result of CRI. Due to an [update in the FrontEnd](https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kestrel_yarp.md), the FrontEnd table will log `400.604` errors (client gone, client disconnected), but the host will continue executing the request from that same client despite the client disconnecting during execution. The following pattern is present in the logs, chronologically:
1. FunctionsLogs logs `HttpRequestExecuting`.
2. FrontEnd logs `400.604` error because the client disconnects.
3. FunctionsLogs eventually logs `HttpRequestExecuted` shortly after and returns the work done by the Function, ignoring/not knowing about the client disconnect.
#### Expected behavior
When the host receives client disconnect information it should cancel the request execution (mostly likely using **cancellation tokens**).
#### Actual behavior
Host continues execution despite the client disconnect.
Contributor guide
Research direction
Start by tracing the host request execution path associated with the FunctionsLogs HttpRequestExecuting and HttpRequestExecuted events, then review how client disconnect information from the FrontEnd is exposed. Check the existing cancellation-token handling around request execution. Done means a disconnect cancels the in-progress Function request rather than allowing the host to continue and return its result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100