Bug 92200 - repeated activation does not report errors consistently
Summary: repeated activation does not report errors consistently
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.10
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: D-Bus Maintainers
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-09-30 17:08 UTC by Simon McVittie
Modified: 2015-10-02 15:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Cancel pending activation on any activation error (7.12 KB, patch)
2015-09-30 17:08 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2015-09-30 17:08:25 UTC
Created attachment 118548 [details] [review]
Cancel pending activation on any activation error

This fixes the error reporting if you make two attempts
to activate a service that cannot be activated due to an
error that is reported synchronously, such as a system
service with no User= line in its .service file.

This is easy to reproduce with the gdbus(1) tool, which
sends an Introspect call in addition to the one you asked
it to. If you try to activate a service using

gdbus call --session -d com.example.FailToActivate \
    -o / -m org.freedesktop.DBus.Peer.Ping

then gdbus will actually send two method calls: one
Introspect, and one Ping. The Introspect gets the correct
error reply, but when dbus-daemon enters
bus_activation_activate_service() for the Ping call, it
sees that there is a pending activation and does an
early-return. The pending activation does not finish
until the timeout is reached.

A couple of error cases handled this correctly, but the
majority did not; make them all go into the same code path.

---

While testing patches like <https://bugzilla.gnome.org/show_bug.cgi?id=755760>, I tried configuring the session dbus-daemon to use /bin/false as the service activation helper, as a way to verify that all activations were indeed going through systemd. The result was that a traditional service activated via gdbus(1) exhibited this bug.
Comment 1 Simon McVittie 2015-09-30 17:09:16 UTC
This is a non-intrusive bug fix, so I intend to apply this to the 1.10 stable branch after review.
Comment 2 Thiago Macieira 2015-10-01 18:49:47 UTC
Comment on attachment 118548 [details] [review]
Cancel pending activation on any activation error

Review of attachment 118548 [details] [review]:
-----------------------------------------------------------------

Looks good.
Comment 3 Simon McVittie 2015-10-02 15:04:31 UTC
Fixed in git for 1.10.1 and 1.11.0, thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.