fix: reduce Linux D-Bus method timeout#15
Merged
jjhafer merged 1 commit intoJun 22, 2026
Conversation
Local D-Bus reads should normally complete within milliseconds. Limit each method call to 500 ms so stalled services release the blocking worker sooner and allow the existing passive fallback to run.
velocitysystems
approved these changes
Jun 22, 2026
jjhafer
approved these changes
Jun 22, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This follows up on the Linux D-Bus timeout discussion from #14 .
A Linux
connection_status()query can make several sequential D-Bus method calls. The existing two-second timeout applied independently to each call, rather than setting an overall deadline for the operation.Consequently, an unresponsive NetworkManager or ModemManager service could cause the individual delays to accumulate while occupying a blocking worker thread.
These calls use the local system bus and primarily read cached service properties. Under normal conditions, they should complete within milliseconds, so a two-second allowance for every method call is unnecessarily high.
What changed
handshake or impose an aggregate deadline on the complete Linux query.
If a method call exceeds the timeout, the existing error handling remains
unchanged and the query uses the passive Linux fallback where applicable.
Tradeoffs and future work
D-Bus communication can take longer during unusual conditions, including:
The 500-millisecond timeout provides substantial headroom over normal
local D-Bus latency while reducing the effect of a stalled service.
This change intentionally does not refactor the D-Bus architecture.
A broader solution—such as an aggregate query deadline, connection reuse,
or a fully asynchronous implementation—would be worth considering if we
observe:
Without evidence of those conditions, lowering the timeout is a smaller
and proportionate improvement.