You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Client disconnects: the client that is invoking your function disconnected. This is most likely for HttpTrigger functions.
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:
@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
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 exceptionFunctionInvocationCanceled
.Reasons you might be seeing the "FunctionInvocationCanceled" exception:
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:Tasks
https://aka.ms/azure-functions-cancellations
The text was updated successfully, but these errors were encountered: