Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 441 forks source link

Execution stops with no output but message still deleted from input queue binding #10227

Closed smythluke closed 2 months ago

smythluke commented 3 months ago

My Azure Function runs in the consumption plan. It is configured with a Storage Queue input binding. Randomly (?) the Function will stop execution with nothing else being written to logs, however the message on the queue still gets deleted.

Investigative information

Invocation example 1:

Invocation example 2:

Invocation example 3:

Invocation that completed successfully in case it helps:

Repro steps

  1. Put a message on the queue that is attached to the function as an input binding.

Expected behavior

The function should either

  1. Fail in some way, log an error, and not delete the message from the queue
  2. Successfully complete, then delete the message from the queue

Actual behavior

After a few log messages, there are no more logs written and yet the message is deleted from the queue. I don't see any errors in the logs and there is nothing to tell me that the function stopped.

Known workarounds

Run the function again and it works some times.

Related information

We're using JavaScript. Extension Bundle version is [4.0.0, 5.0.0)

bhagyshricompany commented 3 months ago

Hi Thanks for updating please share screen shots of code if possible.Thanks

smythluke commented 3 months ago

Hi @bhagyshricompany The code in question is 250 lines long. What is it that would help you diagnose the issue? The code itself doesn't appear to be run anyway.

bhagyshricompany commented 3 months ago

ok will check and let you know.Thanks

bhagyshricompany commented 2 months ago

I create the seemsworking fine.can you try it again

surgupta-msft commented 2 months ago

Checked in the logs at our end. All the invocationIds you have shared were successfully completed. Did you not anything in the Application Insights logs for these invocations?

smythluke commented 2 months ago

Thankyou for looking into this. It was my mistake. The function was invoked a lot in quick succession and the default logging policy samples the logs, making it seem as though it was not completing. Changing the sampling rate shows all the logs in application insights.