-
Notifications
You must be signed in to change notification settings - Fork 25
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
Optimize host shutdown #249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just two suggestions for extra logging. Please consider adding them if you think the granularity will help with debugging.
this.traceHelper.LogDebug("EventHubsTransport is stopping partition and loadmonitor hosts"); | ||
await Task.WhenAll( | ||
this.StopPartitionHostAsync(), | ||
this.StopLoadMonitorHostAsync()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want a log indicating that the WhenAll completed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can skip that one since there is a log statement at the very end of each of the tasks.
this.traceHelper.LogDebug("EventHubsTransport is stopping client"); | ||
await this.client.StopAsync(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want a log indicating the client stopped, not just that it began its stop operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that makes sense.
hmm, I see the CI is failing though. Is it transient or related to this change? |
The CI failures are likely not related. I have seen them a few times already; will work on that separately. |
Currently, when the EventHubsTransport shuts down, it shuts down the client and closes the EH connection only after all the workers are shut down.
This can cause problems if the worker shut down hangs as observed in #245, because the EH client does not shut down, causing issues.
This PR modifies the shut down so that clients & connections are shut down in parallel with the workers. This fixes the problem described above, and also improves the speed of the shutdown process.