beads/internal
Julian Knutsen 685cf848bd
fix(gate): a budget spent during the intent probe still gets the final attempt (#7237)
A farm run of TestAcquireAllExhaustedBudgetFinalAttemptIgnoresIntent
(#7225) failed with "held by a bd maintenance operation queued for
exclusive access" for a gate that was free: a real product race that broke
the guarantee that queued maintenance can delay a shared acquirer but never
fail it.

Acquire decided whether an attempt was final from the clock at the top of
the iteration, then probed the intent lock (open + flock + reading the
sidecar). On a starved machine the probe can take longer than the budget
that was left, so the iteration deferred as "not final", found the budget
spent, and returned ErrBusy without ever trying the gate. Now a deferral
can never end the acquisition: if the budget ran out while deferring, the
loop makes one more attempt at the gate that ignores the queue, and only a
gate that is really held can fail it.

Tests:
- TestSharedFinalAttemptSurvivesStallDuringIntentProbe stalls the
  acquirer past its deadline right after the deferral decision (a
  test-only hook), so the race is reproduced deterministically for both
  Acquire and AcquireAll; it fails with the farm's exact message without
  the fix.
- TestAcquireAllExhaustedBudgetFinalAttemptIgnoresIntent no longer
  releases gate a from a timer racing the budget (a second load-dependent
  failure mode seen in the repro); a is released synchronously after the
  call.

Under load (Bazel server pinned to 2 CPUs with taskset, 32 concurrent test
jobs, race detector): the original test failed 71/200 runs (-test.count=20);
with the fix both tests pass 200/200 (-test.count=10), and the whole
workspacegate_test passes 200/200.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 12:57:09 -07:00
..
ado build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
atomicfile build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
audit build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
beads fix(routing): bind role detection to the bd -C target repo (re-port of #4242) (#5243) 2026-10-04 05:47:27 -07:00
ceiling test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
compact build(bazel): integration-tag lane (--config=integration) matching main.yml (#6916) 2026-09-28 14:11:34 -07:00
config fix(config): bd config unset reported success while the key stayed set (#5760) 2026-10-01 05:07:04 -07:00
configfile Fix ResolveServerMode ambient port-var handling and the KillStaleServers regression it introduced (#5934) 2026-09-30 07:13:57 -07:00
creds test(credentials): make remaining credential-command fixtures native-Windows portable (#5748) (#5749) 2026-09-30 18:30:25 -07:00
debug build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
doltremote fix(doltremote): treat s3:// as a native Dolt remote scheme (#5948) 2026-09-29 06:28:57 -07:00
doltserver feat(backends): registry Remote + OpenWith options; beads.OpenBestAvailableWith for embedders (#7188) 2026-10-04 09:34:36 -07:00
doltversion build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
eventsjournal build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
execenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
fdhygiene build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
formula fix(ci,tests): un-hide TestEmbedded* tests, fence cmd/bd tests from ancestor .beads, cut #7051 race long poles, fix main lint (#7128) 2026-10-03 04:18:14 -07:00
git fix: macOS main job — /private/var symlink in test repo pin; bash 3.2-safe CI scripts (#7165) 2026-10-03 23:08:51 -07:00
gitenv fix(hooks): identify the index context behind tracked-file refusals (#6457) 2026-09-27 18:07:43 -07:00
githooksenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
github feat(github): sync epic/child and blocks relationships to GitHub (#5971) 2026-10-01 01:22:00 -07:00
gitignore fix(worktree): preserve CRLF gitignore appends (#5677) 2026-09-30 01:46:12 -07:00
gitlab build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
gittraceenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
hooks fix(hooks): warn on unsupported async execution (#5673) 2026-10-01 01:08:04 -07:00
httpapi feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
httpclient feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
idgen build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
jira perf(storage): SearchIssueSummaries narrow-projection foundation (be-nu4.3) (#3458) 2026-10-01 01:19:24 -07:00
linear test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
lockfile build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
memoryapi build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
metrics test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
migration build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
molecules test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
notion fix(notion): make the query page bound configurable and honour Retry-After (#6006) 2026-10-04 07:16:26 -07:00
procid build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
query build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
recipes build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
remotecache fix(doltremote): treat s3:// as a native Dolt remote scheme (#5948) 2026-09-29 06:28:57 -07:00
routing fix(routing): bind role detection to the bd -C target repo (re-port of #4242) (#5243) 2026-10-04 05:47:27 -07:00
storage feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
telemetry feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
templates fix(ci,tests): un-hide TestEmbedded* tests, fence cmd/bd tests from ancestor .beads, cut #7051 race long poles, fix main lint (#7128) 2026-10-03 04:18:14 -07:00
testutil ci: fix red nightly (Bazel-skip allowlist, credential helper init); rerun-safe Bazel artifacts (#7096) 2026-10-02 05:42:05 -07:00
timeparsing build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
tracker ci(bazel): dolt-server lane on remote execution (replaces the docker lane) (#6898) 2026-09-28 05:17:36 -07:00
types feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
ui fix(uimd): render bd show DESCRIPTION with terminal's actual background (#5776) 2026-10-01 00:55:37 -07:00
uimd fix(uimd): render bd show DESCRIPTION with terminal's actual background (#5776) 2026-10-01 00:55:37 -07:00
utils Refuse reserved words and fuzzy id matches on bd comment writes (#5393) 2026-10-01 05:04:32 -07:00
validation build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
versioncheck fix(release): name the version-drift remedies that work (#7083) 2026-10-01 11:34:06 -07:00
workapi feat(count): Counter scope — ParentID, NoParent, ExcludeTypes, ExcludeStatus (issues.count.scope) (#7199) 2026-10-05 02:57:14 -07:00
workspacegate fix(gate): a budget spent during the intent probe still gets the final attempt (#7237) 2026-10-05 12:57:09 -07:00
worktreeremove build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00