Repository navigation
fix(telemetry): wait for abandoned dispatch workers before a test ends - #2282
Merged
Merged
Conversation
A dispatch that passes its timeout leaves its worker thread running. When the worker ends its command, it calls get_tracer(). If the floor has already reset the tracer and restored the environment, get_tracer() builds a tracer from the real settings: telemetry on, endpoint port 4318. Its devops-otel thread then connects during another test, and the floor guard fails that test. Name the worker thread, and add a floor fixture that waits for it while the test's isolation holds. A test that does not release its hung command now fails in its own teardown. Refs #2277
Owner
Author
|
Verification, run from a clean worktree rebased on
|
dan-petty
marked this pull request as ready for review
October 26, 2026 03:57
dan-petty
pushed a commit
that referenced
this pull request
Oct 26, 2026
🤖 I have created a release *beep* *boop* --- ## [0.6.1](v0.6.0...v0.6.1) (2026-10-26) ### Bug Fixes * **ai:** the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost ([#2283](#2283)) ([ad7c38b](ad7c38b)) * **cli:** repos sync and branches sync report a failed fetch or pull instead of printing success ([#2276](#2276)) ([bf72be1](bf72be1)) * **github:** pace GraphQL porcelain commands against graphql quota ([#2280](#2280)) ([7f1145a](7f1145a)), closes [#1415](#1415) * **roadmap:** intake keeps the fields a person set on a card added during its planning ([#2278](#2278)) ([21654c6](21654c6)) * **roadmap:** intake leaves the sub-issues of a candidate's source out of the duplicate check ([#2275](#2275)) ([214028c](214028c)) * **telemetry:** wait for abandoned dispatch workers before a test ends ([#2282](#2282)) ([51e8e61](51e8e61)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A command that passes its dispatch timeout leaves its worker thread running, because Python cannot stop a thread.
When that worker ends its command, it calls
get_tracer().If the test floor has already reset the tracer and restored the environment,
get_tracer()builds a tracer from the real settings: telemetry on and endpoint port 4318.The
devops-otelthread of that tracer then connects to loopback port 4318 while another test runs, and the floor guard fails that test.The failure is intermittent because the order of the worker and the floor teardown depends on the load of the host.
#2274 made
OTelTelemetryClient.shutdown()wait for its threads, and the failure stayed.At the reset, the tracer that leaked did not exist yet, so no reset could reach it.
This change:
devops-mcp-dispatch(CONST_MCP_DISPATCH_THREAD_NAME).finish_abandoned_dispatch_workersto the test floor. It depends onisolate_devops_cli_config, so it tears down before the tracer reset and before the restore of the environment. A worker therefore ends against the isolated tracer, which is off and points at the refusing port.docs/TESTING.mdfor the new duty of the floor.The port is not added to a list of allowed connections. The floor is right to refuse it.
Closes #2277
Change:
openspec/changes/archive/2026-10-26-2277-join-abandoned-dispatch-workers/