Azure-functions-host: Service Bus AutoRenewTimeout not configurable

Created on 4 Dec 2016  路  3Comments  路  Source: Azure/azure-functions-host

My Function script will get triggerred by Service Bus several times if the script is running more than 5 mins.

Repro steps

  1. setup a queue in ServiceBus with default TTL, Lock time.

  2. set Function App to run with App Service Plan which doesn't have 5 mins timeout limitation

  3. set host.json with "functionTimeout": "00:50:00"

  4. create a python script to receive message from Service Bus queue

  5. send one message to queue and let script sleep 350 seconds

Expected behavior

My script get triggered once

Actual behavior

After 5 mins and 10 seconds, my script get triggered again
check log here:
https://github.com/SILENCE226/azure/blob/master/function/function.log

Related information

from this document
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus
The message is received by PeekLock mode and should be renewed automatically if the function runs longer than the PeekLock timeout

I suspect the renew mechanism is not working correctly.

My Function script sample code:
https://github.com/SILENCE226/azure/tree/master/function

bug

Most helpful comment

I confirmed this is what was happening. The default value is 5 minutes so Service Bus was releasing the lock, which caused the function to be invoked again with the same message. I have a PR out that allows you to increase AutoRenewTimeout to a custom value.

All 3 comments

@brettsam - Feel free to bump the milestone to next month if needed

@brettsam This may be related to the fact that we don't currently expose a Functions knob for configuring OnMessageOptions.AutoRenewTimeout. We would do that here where we allow other SB OnMessageOptions knobs to be configured. Likely in this case, the AutoRenewTimeout needs to be increased.

I confirmed this is what was happening. The default value is 5 minutes so Service Bus was releasing the lock, which caused the function to be invoked again with the same message. I have a PR out that allows you to increase AutoRenewTimeout to a custom value.

Was this page helpful?
0 / 5 - 0 ratings