-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async HTTP Trigger Function Does Not Cancel Cleanly #10739
Comments
@liliankasem would the recent client disconnect changes improve this scenario? |
Yes, this is the known bug we are working to fix - it will be resolved when these two PRs are released:
I am going to close this issue as a duplicate as we have issues tracking the host and worker fixes (refer to GH issue numbers in the PR) |
Thanks @liliankasem, I couldn't find an issue for this problem but didn't look for a PR, I'm glad it didn't turn out to be me misunderstanding how it ought to work. Thans for the ETAs, do they apply to the production functions support code in Azure, or the local emulated environment run by VS, or both? |
@david-maw - no problem! One of the issues is in the dotnet worker so that might be how you missed it? (issue) Re ETAs: this is for both; however, Core tools can't be released until the Host is released to Azure, so actually the local environment fix will be out after the production fix. It's also worth noting that fix going into the dotnet worker can be used right away by upgrading the nuget package for the AspNet Http extension (when it is published), so half the issue is fixed there (the |
An isolated async function with a
CancellationToken
parameter correctly setsIsCancelRequested
when a client disconnects while the function is running but it also:TaskCancelled
exception (which can be caught in the function)I'm new to Azure Functions so I may have missed something obvious, but I'd expected to see
IsCancelRequested
set and nothing else (no exception unless I threw an uncaught one).The test is simply to invoke the sample function below from a browser then cancel the request before it has chance to complete.
My sample Function code below is just the default code generated by VS with some minor additions.
The local emulator shows:
The text was updated successfully, but these errors were encountered: