GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — secrets-broker: a hung bws child wedges the refresh guard forever (no subprocess deadline) · Issue #10871 · developing-today/code

secrets-broker: a hung bws child wedges the refresh guard forever (no subprocess deadline) #10871

New issue
Copy link
New issue
Copy link
Closed
#10881
Closed
secrets-broker: a hung bws child wedges the refresh guard forever (no subprocess deadline)#10871
#10881
Copy link
Labels
status:done

Description

@dezren39
dezren39
opened on Nov 16, 2026
Issue body actions

Problem

The secrets-broker background refresh can wedge permanently when a single bws child process never returns. Nothing in the refresh path has a deadline, so the refreshing guard is never cleared and every later refresh is rejected.

Evidence

pkgs/fleet/crates/fleet-queue/src/secrets_broker.rs:

  • BwsRunner::run (~L118-136) spawns bws with Command::new(program).args(args).env(...).output(). There is no timeout and no kill.
  • do_refresh (~L226-268) runs bws secret list, then spawns 8 worker threads that each call bws secret get through bws_run (~L143). It then does for h in handles { let _ = h.join(); } (~L266-268). A hung child blocks its worker forever, so join never returns.
  • refresh (~L151-171) sets *refreshing = true before calling do_refresh, and clears it only after do_refresh returns (~L170). A stuck do_refresh therefore leaves refreshing == true for the life of the process.
  • The background loop (~L718-728) calls refresh and then sleeps ttl_s. Once wedged, every iteration returns "refresh already in progress", so the cache is never refreshed again.
  • GET /health reports refreshing (~L543). It shows true indefinitely with no alarm, and last_refresh_error is not updated because the guard returns before the bookkeeping.

Why it matters

The broker is the single source of vault secrets for consumers. Stale-while-revalidate only helps if a refresh eventually finishes. A hang in Bitwarden's CLI, a network stall, or a credential prompt turns "secrets are slightly old" into "secrets are frozen until someone restarts the broker". Restart is the only recovery, and /health does not say why.

Fix shape

  • Give each bws invocation a deadline: spawn, poll try_wait against a bound, kill and reap on expiry, and return an error. Reuse the existing timing constants where possible.
  • Optionally bound the whole do_refresh join, so one slow item cannot hold the guard indefinitely.
  • Make /health or the error log report the timeout, so the wedge is visible.

Acceptance criteria

  • A unit test with a CommandRunner or fake bws that never exits: refresh returns an error within the deadline, refreshing is false afterwards, and the next refresh is attempted.
  • Existing refresh tests still pass.
  • /health refreshing cannot stay true past the deadline.

Related

  • fleet-secrets: bws fallback has no token of its own; broker exchange has no timeout or retry — a 16s broker restart degrades whole consumer runs #10578 (closed): broker client exchange had no timeout. This issue is the separate bws child-process path inside the broker.
  • secrets-broker: live-but-broken instance (stripped PATH, cannot spawn bws) is never replaced by init-ensure liveness check #10868 (open): live-but-broken broker is never replaced. Different failure mode.
  • fleet(secrets-broker): bws refresh fails 'entity not found' — broker serves 503 for github-cli.hosts-yml and the default gh shim hangs #10743 (closed): bws NotFound and gh shim hang. Different cause.

Activity

  1. developing-today commented on Nov 16, 2026

    @developing-today
    developing-todayBot
    on Nov 16, 2026 – with developing.today
    Contributor
    More actions

    CODE-3922

  2. developing-today
    added
    status:in-review
    on Nov 17, 2026
  3. dezren39
    closed this as completedin #10881on Nov 17, 2026
  4. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 17, 2026
  5. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    agent-note:v1
    lane: repo-worker-code (openchamber-scheduled-lane code-j)
    state: already_done
    Fresh state 2026-11-17: #10871 CLOSED (COMPLETED 2026-11-17T00:09:46Z). Fix merged as PR #10881 "fleet-queue: bound bws child runs with a deadline" (merged 2026-11-17T00:09:45Z). No new work is needed. Closing the queue task with this evidence.

  6. dezren39 commented on Nov 18, 2026

    @dezren39
    dezren39
    on Nov 18, 2026
    MemberAuthor
    More actions

    state: verified_closed / already_done
    task: 20680 (repo-health-code-pilot, lane oc-code-03)
    issue: #10871 — secrets-broker: hung bws child wedges refresh guard

    Fresh check 2026-11-18: issue CLOSED (2026-11-17T00:09:46Z). Fix is PR #10881 (fleet-queue: bound bws child runs with a deadline), MERGED 2026-11-17T00:09:45Z, merge commit 8ee773e.

    Disposition: already_done, no follow-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.