A shared bridge the process table cannot identify is read as dead: release skips the stop and orphans a live bridge

Open
#409 10 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@akleizor is already working on this.

Since Nov 10, 2026.

  • #439 by @akleizor — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go
Domain
backend, testing

Research direction

Start with Release in util/sharedbridge.go, then read ours in util/proctable_darwin.go and util/hop.go, plus the lock-holder comment about handling uncertainty. Add a regression test for release when the process table cannot identify a live bridge pid; verify it stops the bridge or preserves its record and config. Update the matching kind in .github/REVIEW.md with the 2026-11-10 incident, checking whether #408 already counted it.

Written by the indexing model from the issue text.

Description

help wanted size:simple

Problem

When the last user releases a shared bridge, ccmorph asks the process table whether the bridge pid is this launch's. When the table cannot tell — an unreadable table, or a row with no arguments — the answer is treated as dead: the pid is cleared, the stop is skipped, and the record and config are removed while the bridge still runs. The next acquire then starts a second bridge on the same auth dir and signs the profile out. A cannot-tell must be read as alive, the way the same file's lock-holder comment already promises.

Evidence

  • util/sharedbridge.go, Release: if !ours(pid, b.TmpDir) { pid = 0 } followed by BridgeStop and os.Remove of the state — ours returns false both for another launch's bridge and for a table that could not answer.
  • util/proctable_darwin.go and util/hop.go: a failed read leaves a row with empty args, so ours answers false on doubt.
  • The same day's #300 thread showed the failure mode live: a doubled slash in the path made ours read a held bridge as dead, and a second bridge started.
  • othersHold's comment in the same file states the rule: a launch must never start a second bridge on doubt.
  • Landed by 04721fb (#294, 2026-11-09).

Acceptance criteria

  • A regression test that fails on 04721fb: with the process table unable to answer for a live bridge pid, release does not orphan the bridge — it stops it, or it leaves the record and config for its owner.
  • .github/REVIEW.md's kind A shared resource torn down or doubled on transient evidence, with state files that outlive their owner names 2026-11-10 in its paragraph; if #408 has already counted its incident, this one adds one more to the same Seen line.

discord-thread:1569632941548638328

Dominant language
Go
Stars
0
Forks
0
Avg merge
4h 41m
Merged PRs (30d)
399

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from akleizor/ccmorph

All issues in akleizor/ccmorph

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.