-
Notifications
You must be signed in to change notification settings - Fork 184
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
Handle cancellation token if function is invoked before cancellation token #2546
Conversation
src/DotNetWorker.Core/Context/Features/DefaultFunctionInputBindingFeature.cs
Show resolved
Hide resolved
The build errors appear unrelated to your change, but I am unsure how they appeared in the first place. |
…t-worker into aibhandari/cancellation-token
Looks like none of the tests in |
We had some wildcard pattern used for nuget packages and one of the package had a patch version bump a week ago, which brought a new version of @aishwaryabh Please rebase after #2549 is merged. |
…t-worker into aibhandari/cancellation-token
Added a unit test to handle the cancellation token |
Issue describing the changes in this PR
resolves #2415
We had a design discussion about this issue and came to the conclusion that we will not use the cancellation token in the pipeline and instead invoke
CancellationToken.None
. That way the customer can still have their function be invoked and handle the cancellation token as they want within their code.To test this out I did the following from guidance from Lilian:
use this sample for the worker app: sample
Updated the tsc here to cancel the token after 5 seconds.
Invoked the HttpTriggerWithCancellation function, set a breakpoint after the token was cancelled, resumed function execution, and saw that a
TaskCancelledException
was invoked when the pipeline's cancellation token was passed in. With my changes, I saw that I was able to modify the function to handle the cancellation token as I wish.Pull request checklist
release_notes.md
Additional information
Additional PR information