fix(linux): remove hourly --server restart that destabilizes desktop sessions#14935
fix(linux): remove hourly --server restart that destabilizes desktop sessions#14935julianjc84 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughRemoves the hourly restart workaround from the Linux service loop. The ChangesLinux service loop hourly restart removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The --service process killed and restarted the --server subprocess every
3600 seconds (or 60 seconds after connection manager closed) as a
workaround for stale DNS resolution and X display detection failures.
Both issues are already handled inline without a process restart:
- DNS: rendezvous_mediator.rs rebinds the UDP socket after consecutive
registration failures (rebind_udp_for, DNS_INTERVAL = 60s)
- Displays: display_service.rs polls for display changes every 300ms
via check_get_displays_changed_msg()
The hourly restart caused:
- IPC disconnection errors every hour ("ipc connection closed: reset by
the peer") logged in ui_interface.rs
- Tray icon removed and re-registered each cycle (XAppStatusIcon churn)
- _NET_ACTIVE_WINDOW messages with timestamp 0 on each server startup
- Memory accumulation over multi-day uptime (peaked at 905MB)
- Cinnamon/Muffin instability leading to general protection faults and
fallback to Metacity after days of continuous operation
Also removes the now-unused get_cm() function, cm0/last_restart
parameters, and Instant import.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: julian <julian@jc84.com>
e3410e0 to
887043a
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platform/linux.rs (1)
899-916: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winKeep
get_cm()until the remaining caller is updated —src/ui.rs:170still callsinline::get_cm(), so removing this helper will break the inline UI path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platform/linux.rs` around lines 899 - 916, Keep the existing helper used by the inline UI path until the remaining caller is migrated. The `inline::get_cm()` reference from `get_cm()` in `src/ui.rs` still depends on this Linux-side logic, so do not remove or bypass it yet; instead, preserve the current `is_login_wayland()`-related support and ensure any refactor keeps `get_cm()` available for that caller.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/platform/linux.rs`:
- Around line 899-916: Keep the existing helper used by the inline UI path until
the remaining caller is migrated. The `inline::get_cm()` reference from
`get_cm()` in `src/ui.rs` still depends on this Linux-side logic, so do not
remove or bypass it yet; instead, preserve the current
`is_login_wayland()`-related support and ensure any refactor keeps `get_cm()`
available for that caller.
Problem
The Linux
--serviceprocess killed and restarted the--serversubprocess every 3600s (or 60s after connection manager closed). This caused:ipc connection closed: reset by the peer)XAppStatusIconremoved and re-registered each cycle)The tray icon is owned by
--server. Killing it hourly tears down the icon's connection to the tray manager and re-registers a fresh one — visible flicker and, on some compositors, leaked references. With this fix the tray icon lives for the whole session.Root cause
The restart was a workaround for stale DNS and X display detection. Both are already handled inline:
rendezvous_mediator.rsrebinds the UDP socket after consecutive registration failures (DNS_INTERVAL = 60s)display_service.rspolls for display changes every 300msSo the restart is redundant and harmful.
Change
start_os_service(src/platform/linux.rs)get_cm(),cm0/last_restartparams,InstantimportTest
Verified on Linux: no IPC errors, stable tray.
Summary by CodeRabbit