forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: clean up channel closing logic
The logic for shutdown is now consolidated and simplified: - rename the .close_channel() method to .drop_channel() to make it clear that it's only about removing the reference from the router. Assert that the channel hasn't already been dropped. - the channel gets dropped from the routing table at exactly one point: when it sends its close message. As such, all channels must send close messages. Implement this in the default `do_close()`. - we no longer drop channels in response to incoming close messages. The Endpoint implementation is always responsible for calling one of the shutdown methods. - Peers no longer track the list of open channels: they request the router handle the shutdown for them, via a new `shutdown_endpoint()` method.. This results in more reliable sending of close messages, particularly in the case of frozen Peers where the channels list isn't filled in yet. This makes Peer shutdown theoretically slower, since we have to iterate the list of all open channels in the router, but the simplification is well worth it.
- Loading branch information
1 parent
f987ffb
commit f02af74
Showing
4 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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