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

Faster graceful daemon cancels #266

Merged
merged 4 commits into from
Nov 30, 2021
Merged

Faster graceful daemon cancels #266

merged 4 commits into from
Nov 30, 2021

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Nov 29, 2021

This was kind of a bug where if the soft wait (await .proc.wait()) in the reaper task was cancelled we could fail over to the hard reap sequence which has a timeout of 3s (currently) before system signalling the subproc.

This adds a test to catch that slower then necessary reaping delay and adds the fix where if the graceful daemon actor proc wait is cancelled we relay that cancellation to the actor via Portal.cancel_actor() which should result in a much faster graceful teardown.

I'm pretty sure I already worked through some of this in the (now history mangled) zombie lord branch..

Currently if the spawn task is waiting on a daemon actor it is likely in
`await proc.wait()`, however, if the actor nursery is subsequently
cancelled this checkpoint will be abandoned and the hard proc reaping
sequence will execute which results in a up to 3 second wait before
a "hard" system signal is sent to the child.  Ideally such
a cancelled-during-daemon-actor-wait condition is instead handled by
first trying to cancel the remote actor using `Portal.cancel_actor()` (a
"graceful" remote cancel request) which should (presuming normal runtime
operation) result in an immediate collection of the process after normal
actor (remotely triggered) runtime cancellation.
@goodboy goodboy force-pushed the faster_daemon_cancels branch from ae4e7c7 to 7eb465a Compare November 29, 2021 21:03
@goodboy
Copy link
Owner Author

goodboy commented Nov 30, 2021

ugh, frickin windows.

@goodboy goodboy added bug Something isn't working supervision cancellation SC teardown semantics and anti-zombie semantics labels Nov 30, 2021
@goodboy goodboy force-pushed the faster_daemon_cancels branch from f2bf1d6 to 16a3321 Compare November 30, 2021 02:52
@goodboy goodboy merged commit d05885d into master Nov 30, 2021
@goodboy goodboy deleted the faster_daemon_cancels branch November 30, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cancellation SC teardown semantics and anti-zombie semantics supervision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant