Skip to content

Release a system proxy left pointing at a dead core - #10

Open
pentaoa wants to merge 1 commit into
wormforce:mainfrom
pentaoa:fix/release-stale-sysproxy
Open

pentaoa wants to merge 1 commit into
wormforce:mainfrom
pentaoa:fix/release-stale-sysproxy

Conversation

@pentaoa

@pentaoa pentaoa commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

What

stop_core_service turns the system proxy off when the user stops the core, but
nothing does when the core dies on its own: a crash, an OOM kill, or a terminal
closing and taking the core with it. The machine is left with its proxy setting
pointing at a closed loopback port, so every proxy-aware app fails - it reads as
"the whole machine lost its internet", and there is nothing in terc that shows
why.

The TUI now drops terc's own entry when it starts and finds the core
unavailable, so opening terc once restores connectivity. The ports lookup the
stop path already did becomes release_stale_sysproxy, shared by both call
sites.

Safety

Only an entry that is loopback on one of this config's ports is touched
(proxy_is_ours and the macOS and GNOME variants); a corporate proxy, or a
loopback proxy on another port, is left alone. Nothing is ever switched on, and
the check runs only when the core is already down.

Testing

cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings,
cargo test --all-targets --locked (340 passed). By hand on the Windows port
this was reported from: stopping the core with the system proxy on, then
launching, leaves the machine on direct internet instead of a dead proxy.

stop_core_service turns the system proxy off when the user stops the core, but
nothing does when the core dies on its own: a crash, an OOM kill, a terminal
that closes and takes the core's process group with it. The machine is then
left pointing every proxy-aware app at a closed loopback port, which reads as
"the whole machine has no internet" and is not something the user can guess.

Terc now drops its own entry when it starts and finds the core unavailable,
so opening terc once restores connectivity. Only an entry that is loopback on
one of this config's ports is touched; a corporate proxy is left alone.

The ports lookup the stop path already did becomes release_stale_sysproxy,
which both call sites share.
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.

1 participant