Skip to content

blueman-applet: serialize RegisterAgent and RequestDefaultAgent#3209

Open
jkuro-tii wants to merge 1 commit intoblueman-project:mainfrom
jkuro-tii:fix/bluez-agent-race
Open

blueman-applet: serialize RegisterAgent and RequestDefaultAgent#3209
jkuro-tii wants to merge 1 commit intoblueman-project:mainfrom
jkuro-tii:fix/bluez-agent-race

Conversation

@jkuro-tii
Copy link
Copy Markdown

Fix race condition where RequestDefaultAgent is sent before RegisterAgent completes in async D-Bus environments (proxies/VMs), causing org.bluez.Error.DoesNotExist.

blueman-applet issues RegisterAgent and RequestDefaultAgent as two independent asynchronous D-Bus calls. In environments where D-Bus message processing or object export is not immediate (e.g. proxies, bridges, containers), this can lead to a race condition where RequestDefaultAgent is executed before the agent is fully registered, causing org.bluez.Error.DoesNotExist.

Fix this by ensuring RequestDefaultAgent is only called after completion of RegisterAgent, restoring correct ordering semantics required by BlueZ AgentManager1 API.

Fix race condition where RequestDefaultAgent is sent before
RegisterAgent completes in async D-Bus environments (proxies/VMs),
causing org.bluez.Error.DoesNotExist.
@sonarqubecloud
Copy link
Copy Markdown

infirit added a commit to infirit/blueman that referenced this pull request Apr 18, 2026
This avoids the possibility we request default agent before an Agent is
registered as reported by blueman-project#3209. But unlike blueman-project#3209 register is async.
@infirit
Copy link
Copy Markdown
Contributor

infirit commented Apr 18, 2026

Thanks for the report. I prefer to keep this async so instead in #3213 blueman request to be default agent when we get a dbus reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants