Skip to content

Stop the in-process sampler when a cooperative attach was abandoned - #60

Merged
MelbourneDeveloper merged 1 commit into
mainfrom
fix/cooperative-abandoned
Nov 18, 2026
Merged

MelbourneDeveloper merged 1 commit into
mainfrom
fix/cooperative-abandoned

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

Fixes the cooperative tail-thread item from the v0.6.0 leak review, which #56 wrongly judged harmless.

When the in-process sampler's header arrived after tail had already given up, the detached tail thread found no receiver and returned. It never wrote the stop sentinel, so the debuggee kept sampling and appending to a file nobody read, for as long as it ran.

Test first: a_header_after_attach_gave_up_stops_the_writer_and_removes_the_file failed with the abandoned sample file stays on disk while its writer keeps sampling.

Fix: the thread now writes the stop sentinel, waits the usual drain grace so the writer sees it, then removes both files.

Verification: the lsp-profiler lib tests (89) and the cooperative tests pass, clippy is clean, and the spec citations resolve.

@MelbourneDeveloper
MelbourneDeveloper merged commit 6957145 into main Nov 18, 2026
10 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the fix/cooperative-abandoned branch November 18, 2026 13:04
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