Skip to content

Fix Linux proxy watcher process lifetime - #21

Merged
Christof Marti (chrmarti) merged 5 commits into
mainfrom
fix-linux-proxy-watcher-lifetime-v2
Aug 25, 2026
Merged

Fix Linux proxy watcher process lifetime#21
Christof Marti (chrmarti) merged 5 commits into
mainfrom
fix-linux-proxy-watcher-lifetime-v2

Conversation

@chrmarti

Copy link
Copy Markdown
Contributor

Summary

Prevent Linux proxy watcher processes from surviving their owning process, including shutdown paths where Rust destructors do not run.

This supersedes #20 and preserves the original fix commit authored by PHPLego (@phplego). The follow-up changes:

  • spawn dconf watch / gsettings monitor from the dedicated watcher thread so PR_SET_PDEATHSIG follows that stable thread instead of whichever caller constructed ProxyResolver
  • use the kernel parent-death signal as a fallback while retaining normal kill/wait cleanup in Drop
  • cover abrupt parent exit and construction on a short-lived caller thread with regression tests
  • scope the implementation explicitly to supported Linux targets
  • direct support requests to microsoft/vscode, since Issues are disabled in this repository

Validation

  • cargo fmt --all --check
  • cargo test --lib --no-default-features --features pac-engine (62 passed)
  • cargo test --lib --no-default-features --features pac-engine watcher_ -- --nocapture
  • cargo clippy --lib --no-default-features --features pac-engine -- -D warnings -A clippy::field-reassign-with-default

The existing CI matrix covers GNU/Linux and musl/Alpine targets on x64 and ARM64.

PHPLego (phplego) and others added 2 commits August 13, 2026 13:55
Spawn the watcher from its dedicated reader thread so Linux parent-death signaling follows the watcher's lifetime rather than an arbitrary caller thread. Add regression coverage for abrupt parent exit and short-lived caller threads, and direct support requests to microsoft/vscode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 13:47
@chrmarti
Christof Marti (chrmarti) marked this pull request as draft August 21, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Prevents Linux proxy watcher subprocesses from leaking when their owner exits without running Rust destructors.

Changes:

  • Spawns watcher commands from a dedicated thread with Linux parent-death signaling.
  • Adds regression tests for abrupt process exit and short-lived creator threads.
  • Updates platform scoping, dependencies, and support guidance.
Show a summary per file
File Description
SUPPORT.md Redirects support requests to microsoft/vscode.
src/platform/mod.rs Restricts the Unix implementation to Linux.
src/platform/linux.rs Implements watcher lifetime handling and tests.
Cargo.toml Adds the Linux-specific libc dependency.
Cargo.lock Records the direct libc dependency.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Run the self-reexec parent-death regression only where the test binary is host-compatible, while retaining architecture-independent watcher coverage. Refresh the addon lockfile and generated third-party notices for the direct libc dependency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mark every non-stdio descriptor close-on-exec before launching dconf or gsettings, with an older-kernel fcntl fallback. Cover the behavior with a regression test using an explicitly inheritable descriptor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the project changelog and align the facade and platform package manifests on version 0.4.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chrmarti
Christof Marti (chrmarti) merged commit 003aa36 into main Aug 25, 2026
31 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the fix-linux-proxy-watcher-lifetime-v2 branch August 25, 2026 07:52
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.

4 participants