Skip to content

Commit

Permalink
python: Retry sd_bus_add_match() on EINTR
Browse files Browse the repository at this point in the history
This happens especially often on RHEL 8.
  • Loading branch information
martinpitt authored and allisonkarlitskaya committed Feb 23, 2023
1 parent 478a29c commit de5b356
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cockpit/channels/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,15 @@ def filter_owner(message):
func = handler
r_string = ','.join(f"{key}='{value}'" for key, value in r.items())
if not self.is_closing():
self.matches.append(self.bus.add_match(r_string, func))
# this gets an EINTR very often especially on RHEL 8
while True:
try:
match = self.bus.add_match(r_string, func)
break
except InterruptedError:
pass

self.matches.append(match)

def add_async_signal_handler(self, handler, **kwargs):
def sync_handler(message):
Expand Down

0 comments on commit de5b356

Please sign in to comment.