-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Timer trigger behavior with host lock #55
Comments
@michaeldaw Can you provide more specific repro steps? Are you saying that restarting func.exe with a short interval will not register the timer correctly? |
@michaeldaw That is rather odd behavior! I'll try to repro and see what's going on. I suspect it might have to do with the underlying behavior of the runtime, but I'll find out. |
I've experienced this behavior as well. Seems to happen more often when you stop the Azure Function host pretty soon after start, and immediately restarting. |
@mathewc Could you weigh in on the behavior here? I'm guessing there's something specific to the script host going on. |
I'm having the exact same behavior. |
It turns out the CLI should do some special work to make the timer trigger behave as expected. From @mathewc:
|
Thank you for the explanation, Donna. It sounds like we could configure the host.json file in local development to change the ListenerLockPeriod setting according to this schema: https://github.com/Azure/azure-webjobs-sdk-script/wiki/host.json |
Just to follow up, I've been using the 15 second "ListenerLockPeriod" setting described above and it significantly improves the development/debugging experience. In case it's helps anyone, here's an example host.json file that will put this setting in to effect:
|
Can you clarify wehter this setting will have negative affects on azure (online) as it is in the host.json file? Is there a reason for the default being higher than 15s? |
In steady state production, you want to accept the default of 60s because it will reduce the number of lease renewal attempts the host has to do. The logic is to start renewal attempts once half the interval has expired, speeding up renewal attempts as the expiry gets closer. You shouldn't have to set the default to 15s yourself - the CLI should be doing that automatically, putting the host into "debug mode" optimized for local development. @ahmelsayed You're right that you only want that lower value for local debugging, not production. |
@mathewc Thanks for the clarification |
Closing extenal issue. |
Hi,
I've found that if I'm testing a Function locally that uses a Timer trigger, it doesn't always get run by the CLI. Typically, when running a timer trigger function, the CLI will output the clock time for the next five times that the function is scheduled to run. However, if you end a session of func.exe and then quickly start it again, the timer triggered functions will not be added to the job.
The text was updated successfully, but these errors were encountered: