Skip to content

Conversation

@liliankasem
Copy link
Member

@liliankasem liliankasem commented Jul 19, 2022

Issue describing the changes in this PR

resolves #2152

Implementing the InvocationCancel message so provide cancellation token support for out-of-proc language workers.

First, we setup the CancellationToken from WebJobs to be passed into the invocation context parameters list. This enables us to flow the CancellationToken to the InvokeCore method and eventually to SendInvocationRequest.

Within SendInvocationRequest, we register a callback for the CancellationToken so that when it is cancelled, we send the InvocationCancel message to the worker. This feature is built behind a worker capability flag, if a worker does not have a cancellation capability, we will not send the InvocationCancel message

Design document available in the wiki.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

@liliankasem liliankasem marked this pull request as ready for review July 19, 2022 19:48
Copy link
Member

@kshyju kshyju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few questions to understand the implementation better. Thanks!

@fabiocav fabiocav requested review from kshyju and surgupta-msft July 21, 2022 20:11
Copy link
Member

@satvu satvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@liliankasem liliankasem merged commit 91e0d11 into dev Aug 15, 2022
@liliankasem liliankasem deleted the liliankasem/outofproc-cancellation-token branch August 15, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide out-of-proc support for cancellation tokens

6 participants