azure-functions-python-worker icon indicating copy to clipboard operation
azure-functions-python-worker copied to clipboard

Cancellation of HTTP triggers waiting for python language workers does not work

Open miqm opened this issue 4 years ago • 4 comments

Check for a solution in the Azure portal

For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select Diagnose and solve problems from the left, and view relevant dashboards before opening your issue.

Investigative information

Please provide the following:

  • Timestamp: 2021-11-08T16:46:57.915Z
  • Function App version: mcr.microsoft.com/azure-functions/python:3.0-python3.8-appservice
  • Function App name:
  • Function name(s) (as appropriate):
  • Invocation ID: fa416bc3-f801-45db-939a-2145fcef7bee
  • Region: West Europe

Repro steps

Provide the steps required to reproduce the problem:

  1. Create a function app with 2 functions
  2. trigger function 1 that will have a long IO operation and will take the language worker
  3. trigger function 2 which is a HTTP one multiple times and cancel requests before they are handled by language worker

Expected behavior

Provide a description of the expected behavior.

HTTP-triggered Function invocations waiting for language worker should not be processed if client closed the request while function is waiting in queue.

Actual behavior

Provide a description of the actual behavior observed.

HTTP function executes long after client gave up waiting and closed the connection.

Known workarounds

Provide a description of any known workarounds.

In C# we can get a cancellation token from request context. but here the request sits in function host and arrives to python worker afer seconds or minutes. No workaround known.

Related information

Provide any related information

  • Programming language used: Python
  • Links to source: n/a
  • Bindings used: none, HTTP trigger

miqm avatar Nov 08 '21 22:11 miqm

Thank you for your feedback! We will check for the possibilities internally and update you with the findings.

Ved2806 avatar Nov 16 '21 13:11 Ved2806

@miqm we would be tracking this as a feature request.

Ved2806 avatar Nov 18 '21 17:11 Ved2806

Awesome. Will this be part of current runtime or we'd need to wait for next major release?

miqm avatar Nov 21 '21 08:11 miqm

@brettsam Any update on this?

miqm avatar Aug 22 '23 13:08 miqm