Skip to content

Fix noisy shutdown warnings from worker pool and bridge#173

Open
sueszli wants to merge 2 commits intopiercefreeman:mainfrom
sueszli:exploratory
Open

Fix noisy shutdown warnings from worker pool and bridge#173
sueszli wants to merge 2 commits intopiercefreeman:mainfrom
sueszli:exploratory

Conversation

@sueszli
Copy link
Contributor

@sueszli sueszli commented Feb 17, 2026

Two bugs caused spurious warnings on every clean shutdown:

  1. RemoteWorkerPool::launch() cloned Arc<PythonWorkerPool> into the dispatcher task, keeping the refcount above 1. When shutdown() called Arc::try_unwrap(inner.pool) it always failed, skipping pool shutdown entirely (and with it, bridge shutdown). Fixed by holding Weak in the dispatcher and upgrading per-request instead.

  2. WorkerBridgeServer reader tasks warn on stream errors, but killing worker processes necessarily closes their gRPC connections with a broken pipe. Fixed by adding a shutting_down flag to WorkerBridgeState, set via mark_shutting_down() before the worker-kill loop, so expected connection errors during planned shutdown are silenced. Unexpected errors during normal operation still warn.

Additionally mutes build warning:

   Compiling waymark v0.1.0 (/Users/sueszli/dev/waymark)
warning: unused import: `std::sync::OnceLock`
 --> src/observability.rs:5:5
  |
5 | use std::sync::OnceLock;
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

@sueszli sueszli changed the title Mute unused import warning Patch unused import warning Feb 17, 2026
@sueszli sueszli changed the title Patch unused import warning Fix noisy shutdown warnings from worker pool and bridge Feb 17, 2026
@sueszli
Copy link
Contributor Author

sueszli commented Feb 17, 2026

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