Bug 2172846

Summary: sd_bus_add_match often fails with EINTR "Interrupted system call"
Product: Red Hat Enterprise Linux 8 Reporter: Martin Pitt <mpitt>
Component: systemdAssignee: David Tardon <dtardon>
Status: VERIFIED --- QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.8CC: dtardon, jamacku, orion, systemd-maint-list
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: CockpitTest
Fixed In Version: systemd-239-77.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Pitt 2023-02-23 09:59:11 UTC
Description of problem: The cockpit team is working on a new feature to connect to machines which don't have any Cockpit packages installed. For that we use libsystemd's sd-bus API. We noticed that we get a lot of failures like this:

   InterruptedError: [Errno 4] sd_bus_add_match: Interrupted system call

when setting up D-Bus watches. This does not happen on RHEL 9 and current Fedora, as it was fixed upstream already:

   https://github.com/systemd/systemd/commit/b3d06b9226db96fddb6bb45a4708e2e8d413d91d
   https://github.com/systemd/systemd/commit/3022916b4d2483452c3ddbbac9ee7c4372b1cb46

We have a workaround in Cockpit:

    https://github.com/cockpit-project/cockpit/commit/de5b3562827f2662df11621cff3e55a717e55967

But this is suboptimal -- it can happen to other code paths as well, and likely also to other consumers of the sd-bus API.


Version-Release number of selected component (if applicable):

systemd-libs-239-72.el8.x86_64


How reproducible: Very reliably when running Cockpit's test suite (about 10 in 300 tests fail on this, like in https://cockpit-logs.us-east-1.linodeobjects.com/pull-18318-20230216-065702-d382fce4-centos-8-stream-pybridge/log.html#69 .

However, I don't have an isolated standalone reproducer.

Comment 1 Martin Pitt 2023-02-23 10:12:07 UTC
Let's make this explicit: Could these two commits be backported to RHEL, please?

Comment 2 David Tardon 2023-02-28 08:54:31 UTC
(In reply to Martin Pitt from comment #1)
> Let's make this explicit: Could these two commits be backported to RHEL,
> please?

Yes, they can. This came around before (bug 2137584), but it was just a potential issue then, so we decided not to do anything in RHEL-8.

Comment 3 Lukáš Nykrýn 2023-05-29 12:33:36 UTC
*** Bug 2210317 has been marked as a duplicate of this bug. ***

Comment 4 Plumber Bot 2023-06-14 15:43:06 UTC
fix merged to github main branch -> https://github.com/redhat-plumbers/systemd-rhel8/pull/372