Skip to content

fix(gui-client): don't block shutdown on notification - #13835

Merged
jamilbk merged 1 commit into
mainfrom
fix/no-block-shutdown
Jun 24, 2026
Merged

fix(gui-client): don't block shutdown on notification#13835
jamilbk merged 1 commit into
mainfrom
fix/no-block-shutdown

Conversation

@thomaseizinger

Copy link
Copy Markdown
Member

In order to display notifications reliably on Linux, we need to attach a handler to it, otherwise the D-bus connection gets dropped immediately. Using on_close uses the blocking thread-pool internally however which can cause a dead-lock during runtime shutdown because tasks on the blocking thread-pool cannot be preempted, preventing the GUI process from exiting if there is still a not-dismissed notification.

To fix this, we use the async variant to wait for the notification action.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Linux GUI client’s notification handling to avoid a shutdown deadlock caused by notify-rust’s on_close using Tokio’s blocking thread-pool. Instead, it keeps the D-Bus connection alive by awaiting the async action-wait API inside a spawned async task.

Changes:

  • Replace notification.on_close(|| {}) with notification.wait_for_action_async(|_| {}).await on Linux.
  • Ensure notification action handling stays on the async scheduler rather than Tokio’s blocking pool during runtime shutdown.

@thomaseizinger
thomaseizinger added this pull request to the merge queue Jun 24, 2026
@jamilbk
jamilbk removed this pull request from the merge queue due to a manual request Jun 24, 2026
@jamilbk
jamilbk merged commit 7300a90 into main Jun 24, 2026
58 checks passed
@jamilbk
jamilbk deleted the fix/no-block-shutdown branch June 24, 2026 16:35
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.

3 participants