Skip to content

Commit

Permalink
dbus channel: make 'close' message idempotent
Browse files Browse the repository at this point in the history
It's theoretically possible that the user might send multiple 'close'
messages to a D-Bus channel, which would have a chance to be delivered
because the channel doesn't close immediately (but rather waits for
outstanding requests to complete).

This is a pretty theoretical bug but it's going to get worse when we
modify how the router shutdown works in the next commit.
  • Loading branch information
allisonkarlitskaya committed Nov 2, 2023
1 parent be5a593 commit 2fe04ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cockpit/channels/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,5 +511,5 @@ def do_data(self, data):
def do_close(self):
for slot in self.matches:
slot.cancel()
self.matches = None # error out
self.matches = []
self.close()

0 comments on commit 2fe04ba

Please sign in to comment.