Skip to content

fix(status-area): don't let one hung SNI item stall the whole tray at startup#1428

Open
BrianHotopp wants to merge 1 commit into
pop-os:masterfrom
BrianHotopp:fix-sni-seed-concurrency
Open

fix(status-area): don't let one hung SNI item stall the whole tray at startup#1428
BrianHotopp wants to merge 1 commit into
pop-os:masterfrom
BrianHotopp:fix-sni-seed-concurrency

Conversation

@BrianHotopp
Copy link
Copy Markdown
Contributor

@BrianHotopp BrianHotopp commented May 29, 2026

Serial seeding of already-registered StatusNotifierItems plus zbus' unbounded default method timeout let one hung SNI service block every later seed item. The seed stream was also .chained ahead of the live signal streams, so no live Registered/Unregistered event was delivered until seeding finished — one wedged item stalled the entire tray subscription. This seeds concurrently with bounded fan-out (buffered(16), which preserves the watcher's enumeration order), merges the seed with the live streams via stream_select! so live registrations flow during seeding, and caps per-item construction with a 5s timeout so a wedged item yields Event::Error instead of stalling.

Test plan

  • In-container cargo build -p cosmic-applet-status-area is green.
  • The stream wiring is not unit-tested (would require a hang-on-demand fake watcher).

  • I have disclosed use of any AI generated code in my commit messages.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

// longer blocks the rest. `buffered` (not `buffer_unordered`) preserves the
// watcher's enumeration order, so initial icon order stays deterministic;
// the per-item timeout below caps head-of-line blocking, so a single wedged
// item delays the others by at most that timeout rather than forever.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this comment be removed? It's better to have summaries of the change in the commit description.

@mmstick
Copy link
Copy Markdown
Member

mmstick commented May 29, 2026

You must include the PR template and your commits must declare that they contain LLM-generated code if any part of it was generated.

@BrianHotopp BrianHotopp force-pushed the fix-sni-seed-concurrency branch 2 times, most recently from 06a78d5 to ffc1a9f Compare May 29, 2026 17:34
… startup

The watcher seeded registered StatusNotifierItems serially and zbus' default
method timeout is unbounded, so one unresponsive SNI service blocked every
later seed item; the seed was also `.chain`ed ahead of the live signal
streams, so live Registered/Unregistered events were withheld until seeding
finished, wedging the whole tray. Seed concurrently with bounded fan-out
(`buffered(16)`, which preserves enumeration order), merge with the live
streams via `stream_select!`, and cap per-item construction with a 5s
timeout so a wedged item yields Event::Error instead of stalling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BrianHotopp BrianHotopp force-pushed the fix-sni-seed-concurrency branch from ffc1a9f to 15156f8 Compare May 29, 2026 21:08
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