Repository navigation
fix(relay): drain sessions before idle hub cleanup - #179
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relay's central inactivity sweep cancels a disconnected user hub, whose cleanup then cancels its session plugin. That bypasses Session's cooperative finish and can interrupt long-running server-side work even after Session defers disconnect retirement.
The sweep now sends a private retirement request. A disconnected hub waits for its monitored session plugin to exit before ordinary cleanup. JOIN cancels retirement and resumes the same plugin; an empty hub exits immediately. Retirement survives hot upgrade, and a retiring hub does not restart the session plugin it is waiting to collect.
Only the owning central PID can request hub retirement. Central does not forward incoming retirement requests as trusted broadcasts, and only the registered hub PID can update its client count. The change adds no timers, worker coroutines, acknowledgements or grace-period machinery. Explicit service cancellation keeps its forced-shutdown behavior.
Validation:
Companion: wippyai/session#65
Deploy with the companion Session lifecycle fix: Session must allow accepted work to finish when receiving shutdown. Other plugins retain their existing hub-cleanup behavior. This PR changes inactivity collection, not administrative service cancellation or redeploy policy.