Open Thnslj opened 7 years ago
It looks like our Listeners are inconsistent wrt whether they allow in-process invocations to complete when StopAsync()
is called. Some examples:
@MikeStall / @mathewc / @davidebbo -- is there a 'best practice' for how Listeners should behave in this situation? It seems like waiting for current executions to complete is desirable. Should we try to get all Listeners to behave that way?
The drawback is that it's possible that a call to StopAsync()
never returns -- or takes a very long time.
It'd be good for listeners to behave consistently. Even better if we can structure the extensibility model such that consistency is enforced. There's a few things to consider:
I have implemented a draining flag to allow current Function runs to complete before stopping the process. When the flag is set i call the
cancellationTokenSource.Cancel()
and then calls jobHost.Stop().Expected behavior
jobHost.Stop();
Should wait for functions started byServiceBusListener
to complete. Just likeTaskSeriesTimer
is implemented.From
TaskSeriesTimer.cs
Actual behavior
jobHost.Stop();
Returns immediatelyRelated information
Package version:
<package id="Microsoft.Azure.WebJobs" version="2.0.0-beta1-10456" targetFramework="net461" />