Skip to content
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

[SignalR] Move to generic host #22602

Merged
merged 9 commits into from
Jun 23, 2020
Merged

[SignalR] Move to generic host #22602

merged 9 commits into from
Jun 23, 2020

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy commented Jun 5, 2020

Part of #20964

Easier to review with whitespace turned off

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Jun 5, 2020
@BrennanConroy BrennanConroy requested a review from Tratcher June 5, 2020 21:56
@Tratcher
Copy link
Member

Looks good. Still need to fix the ref assembly?

@BrennanConroy
Copy link
Member Author

Still need to fix the ref assembly?

Yeah. And I'm still trying to figure out the issue with close. Wont remove from draft until I've figured that out.

@BrennanConroy BrennanConroy marked this pull request as ready for review June 12, 2020 23:00
@BrennanConroy BrennanConroy requested a review from halter73 as a code owner June 12, 2020 23:00
finally
{
await _host.StopAsync();
_host.Dispose();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidfowl @Tratcher

@BrennanConroy and I learned by investigating test failures related to this change that unlike WebHost.Dispose(), the generic Host.Dispose() just disposes all services.

Even when configured with ConfigureWebHost, Host.Dispose() does not fire ApplicationStopping, ApplicationStopped or call IServer.StopAsync(). Instead KestrelServer just gets disposed which completely bypasses graceful shutdown and aborts all connections. Naturally, this lead to DiagnosticMemoryPool errors in the tests.

I think we should make Host.Dispose() gracefully shutdown the server like WebHost.Dispose() did. Should I file an issue for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to open an issue for triage, it's out of scope for this PR.

I don't think Dispose should be graceful, that's why we added Stop and helpers like Run that call Stop and Dispose for you. I think this was a conscious choice back in 2.2 or 3.0, if not widely discussed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was in no way suggesting we change the generic host behavior in this PR. I'm just gauging whether it's worthwhile to even create an issue. It doesn't sound like we're too concerned. Having Dispose() be abortive does make it less sync-over-async which is nice.

…alTestApp.csproj

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
@BrennanConroy
Copy link
Member Author

I don't think I can merge this :/

For some reason it makes the issue at dotnet/runtime#30056 happen occasionally and we're trying to reduce overall flakiness, not introduce more!

@BrennanConroy BrennanConroy added the blocked The work on this issue is blocked due to some dependency label Jun 17, 2020
@BrennanConroy
Copy link
Member Author

Ran this multiple times on Mac after changing to new HostBuilder() and haven't seen the issue.

@Tratcher
Copy link
Member

:shipit:

@BrennanConroy BrennanConroy merged commit a1c226e into master Jun 23, 2020
@BrennanConroy BrennanConroy deleted the brecon/host branch June 23, 2020 17:46
@dougbu dougbu removed the blocked The work on this issue is blocked due to some dependency label Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants