Open brettsam opened 6 years ago
I believe this may be a bug in the Event Hub trigger. It looks like it's not set up to handle StopAsync()
being called while StartAsync()
is executing. If Start()
is in the middle of registering a handler while Stop()
is called, it looks like it'll be a no-op and the listener will continue running:
Rather than create a new issue -- I'll reactivate this one. It looks like we still have an issue here. I can see an EventHubListener getting started during a retry after the host is stopped. It tries to process events on a disposed host for a while:
FunctionsLogs
| where PreciseTimeStamp > datetime(2019-02-13 07:20) and PreciseTimeStamp < datetime(2019-02-13 10:00)
| where AppName == "rdc-func-app"
| where HostInstanceId == "95ea2cfb-05cd-4952-8cb2-36177aed7912"
| project PreciseTimeStamp, Details, Summary, HostInstanceId, Level, HostVersion
Customer reported an issue and when I looked into it, I could see that we were running a disposed host for several hours. When walking back through the logs, I noticed that it appears we are retrying a failed listener after the Job host has been stopped. This causes the stopped, disposed host to continue running functions indefinitely, which causes constant failures until the host is restarted.
Change that implemented this was https://github.com/Azure/azure-webjobs-sdk/pull/1647
Relevant log lines: