You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mathewc / @fabiocav -- this feels like a requirement we should be pushing to the Listeners to me. We could likely make this better by blocking the StopAsync() call if there's any outstanding StartAsync() running, but I'm nervous that it'd introduce some other timing issues. I wanted to get your opinions.
The text was updated successfully, but these errors were encountered:
The check for
_started
inFunctionListner
is not synchronized acrossStartAsync()
andStopAsync()
calls (https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/Listeners/FunctionListener.cs#L139).This means that the following scenario can result in a
Listener
being disposed before it is stopped:StartAsync()
fails, resulting in the retryTask
being started.StartAsync()
, but_started
is stillfalse), the host is shut down, meaning
StopAsync()` is called.StopAsync()
returns quickly without doing anything, meaning theListener
can now be disposed.StartAsync()
completes and callsStopAsync()
here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/Listeners/FunctionListener.cs#L119If a Listener doesn't anticipate this, it is possible that it can invoke some functions on a disposed host, resulting in a
HostDisposedException
. This happens to the EventHub trigger, for example, because it doesn't seem to do anything inDispose
: https://github.com/Azure/azure-functions-eventhubs-extension/blob/dev/src/Microsoft.Azure.WebJobs.Extensions.EventHubs/Listeners/EventHubListener.cs#L72.The SB Listener, on the other hand, does handle this so it likely doesn't have this issue: https://github.com/Azure/azure-functions-servicebus-extension/blob/dev/src/Microsoft.Azure.WebJobs.Extensions.ServiceBus/Listeners/ServiceBusListener.cs#L176.
@mathewc / @fabiocav -- this feels like a requirement we should be pushing to the Listeners to me. We could likely make this better by blocking the
StopAsync()
call if there's any outstandingStartAsync()
running, but I'm nervous that it'd introduce some other timing issues. I wanted to get your opinions.The text was updated successfully, but these errors were encountered: