Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Support shutting down the handler ignoring any keepAlive periods #27

Merged
merged 4 commits into from
Apr 23, 2020

Conversation

DanTup
Copy link
Contributor

@DanTup DanTup commented Apr 15, 2020

I think we need something like this in order to fix dart-lang/webdev#950. The issue is that the keepAlive period fires for the injected client handler and prevents the daemon from ending until the keepAlive timer runs out.

This exposes a shutdown method on the handler that will close all connections ignoring the keepAlive.

This is for application-initiated shutdowns (for ex. hitting Ctrl+C in the terminal of a running server).
@DanTup
Copy link
Contributor Author

DanTup commented Apr 15, 2020

This fix might not be complete... The test passes, but in webdev it still hangs (possibly due to the timers not being cancelled)... will look for a way to fix.

@DanTup
Copy link
Contributor Author

DanTup commented Apr 15, 2020

(ok, this seems to work now)

@DanTup
Copy link
Contributor Author

DanTup commented Apr 22, 2020

@jakemac53 @grouma ping!

@grouma grouma self-requested a review April 22, 2020 18:55
@grouma
Copy link
Contributor

grouma commented Apr 22, 2020

Let's get a changelog and version update and I'll publish. Otherwise LGTM.

@DanTup
Copy link
Contributor Author

DanTup commented Apr 23, 2020

Done, thanks!

Copy link
Contributor

@grouma grouma left a comment

Choose a reason for hiding this comment

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

Sorry. One last minor fix.

// Close the underlying connection.
handler.shutdown();

// The isInKeepAlivePeriod flag may only be set for a short period because
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment no longer makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

np, updated!

@grouma grouma merged commit e5cf689 into dart-archive:master Apr 23, 2020
mosuem pushed a commit to dart-lang/tools that referenced this pull request Dec 10, 2024
…t-archive/sse#27)

* Support shutting down the handler ignoring any keepAlive periods
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Daemon doesn't quit when sent SIGINT/SIGTERM
2 participants