Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
333 stars 103 forks source link

python (v2) azure function stopping execution without proper completion without failing (host stops) #1213

Closed average-everyman closed 1 year ago

average-everyman commented 1 year ago

My Azure Function using Python (V2 programming model) is in consumption plan. It is a synchronous script that is triggered by a schedule (cron). It is supposed to execute 5 different calls to an API (using requests) to get some data, and write the responses in the blob storage. The function executes initially 1 or 2 or 3 calls, and each time it writes the results to the blob, however it then suddenly stops without a clear "failure" or "exception" (the host instance stops) and starts all over again with the new invocation ID (and the new host instance starts). After few cycles like that the function eventually executes the expected number of API calls. I initially expected that this issue is related to timeout but the entire execution happens in seconds.

By the way, I am using synchronous processing as I assume Python deployment is single thread, and I expect function to be executed sequentially statement after statement etc.

Investigative information

Please provide the following:

  invocation id host instance id
last incomplete invocation 501d84a1-8d2d-4926-ab33-048741b94068 7d9fd8ed-e770-4357-b214-b88cc9cab14f
first next complete invocation 815b40b1-8d34-48d2-956f-6663223ce8d9 71b25cce-d84d-47cb-9b6d-4cb11cfdce6e

Please let me know if you would rather have newer events.

Expected behavior

Function executes fully i.e. makes 5 API calls and does 5 writes to blob before completing the execution.

bhagyshricompany commented 1 year ago

Thanks for informing will check and update you

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.