Skip to content
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

Documentation for cancellation scenarios and troubleshooting #9530

Open
1 of 3 tasks
liliankasem opened this issue Sep 12, 2023 · 2 comments
Open
1 of 3 tasks

Documentation for cancellation scenarios and troubleshooting #9530

liliankasem opened this issue Sep 12, 2023 · 2 comments

Comments

@liliankasem
Copy link
Member

liliankasem commented Sep 12, 2023

Documentation updated required with this change: #9523

We will need to find the appropriate place to add documentation about the Cancellation has been requested. The invocation request with id '{invocationId}' is canceled and will not be sent to the worker log and the exception FunctionInvocationCanceled.

Reasons you might be seeing the "FunctionInvocationCanceled" exception:

  1. Client disconnects: the client that is invoking your function disconnected. This is most likely for HttpTrigger functions.
  2. Function App restarts: if you or the platform restart your Function App around the same time an invocation is requested. This should not have any impact as when the host starts back up it will retry the request.
    • Restarts could occur due to worker instance movements, worker instance updates, or scaling

TODO: document other reasons this issue could occur.

The default behaviour is that the host will not send invocations to the worker if the platform cancellation token has been signaled before we send the invocation request for a given invocation.

If a worker has the HandlesInvocationCancelMessage capability where it is able to handle cancellation tokens, then in this case the behaviour changes and we will send the invocation through to the worker even if the cancellation was signaled before we get to sending the invocation request.

In the case that customers want to override this behaviour where the worker does support "HandlesInvocationCancelMessage" but they do not want pre-cancelled invocations to be sent to the worker, they can set "SendCanceledInvocationsToTheWorker" to false in the host.json file:

{
    "version": "2.0",
    "SendCanceledInvocationsToWorker": "false"
}

Tasks

@fabiocav
Copy link
Member

This is blocked on completion of the design/approach for cancellation flows.

@liliankasem
Copy link
Member Author

@fabiocav @mattchenderson - I've updated the issue description to document the new behaviour and how folks can opt out via the new host config. Is there anything you'd like to add to this? Fabio, can you help with the todo "document other reasons this issue could occur."?

Once the PR merges, I will make a schema PR change to add the new host config property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants