beads/internal/storage/dbproxy/proxy
Julian Knutsen c9a36b248c
fix(dbproxy): wait out a live starter's spawn marker instead of a fixed 5s (#7249)
Shutdown advances the stop epoch, then waits while a live starter's
proxy.spawn marker covers the release-lock-before-exec window. That wait
shared shutdownConfirmDeadline (5s) with the kill/confirm phases, but the
starter legitimately holds the marker longer: it waits up to openDeadline
for the child to take proxy.lock (which clears the marker) and then up to
shutdownConfirmDeadline each to kill the child and clear the marker. On a
loaded host (CI -race runners) a slow fork/exec pushed the start past 5s
and `bd dolt stop` reported "proxy.Shutdown partial: backend stopped;
proxy left running: timeout (5s) waiting for spawn marker" for a start that
was still progressing and about to abort on the advanced epoch. This is the
TestShutdownWaitsForStartDelayedBeforeExec flake.

The marker is only treated as active while its owner's verified identity
is alive (a dead owner's marker is removed on sight), so bound the wait by
the starter's own budgets (shutdownSpawnWaitDeadline = openDeadline +
2*shutdownConfirmDeadline) and give the post-start stop phases a fresh
shutdownConfirmDeadline once the marker resolves.

Tests: TestShutdownWaitsForLiveStarterPastConfirmDeadline holds the start
before exec past shutdownConfirmDeadline; it fails deterministically with
the CI signature before this change. Both spawn/stop tests share a helper
and use generous hang-detector timeouts.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 08:53:11 -07:00
..
backend.go /{internal,cmd,.gitignore}: wip, proxy server fixes and uow impl 2026-05-10 06:57:41 -07:00
backend_dial_timeout_test.go test(proxy): topology-parameterized history and remote front-door matrix (#6269) 2026-09-05 08:25:49 -07:00
BUILD.bazel fix(proxy): fail fast with a clear MySQL error when an external upstream is unreachable (#7181) 2026-10-04 02:37:58 -07:00
control.go test(dbproxy): make accept retry test event-driven (bd-pccmh) (#5263) 2026-08-01 19:49:04 -07:00
control_test.go test(dbproxy): make accept retry test event-driven (bd-pccmh) (#5263) 2026-08-01 19:49:04 -07:00
endpoint.go fix(dbproxy): managed-local dolt readiness proves port ownership; recover onto a free port (#7184) 2026-10-04 04:24:32 -07:00
endpoint_mismatch_test.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
endpoint_no_data_probe_test.go perf(storage): stop burning two wasted MySQL sessions per bd invocation (wy-s8ytnw) (#6122) 2026-09-12 09:38:01 -07:00
endpoint_security_test.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
endpoint_spawn_stop_unix_test.go fix(dbproxy): wait out a live starter's spawn marker instead of a fixed 5s (#7249) 2026-10-05 08:53:11 -07:00
endpoint_unix.go Triage and clean up an unreviewed automated commit stream on main (#4418) 2026-06-15 20:24:57 -07:00
endpoint_windows.go Triage and clean up an unreviewed automated commit stream on main (#4418) 2026-06-15 20:24:57 -07:00
external_transport_lifecycle_internal_test.go fix(proxy): fail fast with a clear MySQL error when an external upstream is unreachable (#7181) 2026-10-04 02:37:58 -07:00
force_stop.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
force_stop_linux_test.go test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
process_executable_darwin.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
process_executable_linux.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
process_executable_windows.go fix(lint): check deferred windows.CloseHandle returns (errcheck) (#5088) 2026-07-26 14:47:37 -07:00
proxy.go /{internal,cmd,.gitignore}: wip, proxy server fixes and uow impl 2026-05-10 06:57:41 -07:00
read_status.go fix(dolt): contain bd dolt start on proxied workspaces; make bd dolt status truthful (#6577) 2026-09-22 15:06:06 -07:00
server.go fix(dbproxy): managed-local dolt readiness proves port ownership; recover onto a free port (#7184) 2026-10-04 04:24:32 -07:00
server_epoch_internal_test.go fix(proxy): stop doomed proxied starts from starving concurrent Shutdown of proxy.lock (bd-ill4f) (#5354) 2026-08-05 07:36:35 -07:00
server_test.go test(proxy): topology-parameterized history and remote front-door matrix (#6269) 2026-09-05 08:25:49 -07:00
shutdown.go fix(dbproxy): wait out a live starter's spawn marker instead of a fixed 5s (#7249) 2026-10-05 08:53:11 -07:00
stats.go fix(proxy): fail fast with a clear MySQL error when an external upstream is unreachable (#7181) 2026-10-04 02:37:58 -07:00
unverified_process_darwin.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
unverified_process_linux.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
unverified_process_unsupported.go fix(build): restore freebsd compilation with unsupported-platform stubs for procid + unverified-process (release v1.2.0 blocker) (#5661) 2026-08-11 14:03:44 -07:00
unverified_process_windows.go fix(dbproxy): verified identity for the managed proxied-server lifecycle (adoption, cleanup, kills) (#5013) 2026-07-26 12:52:51 -07:00
upstream_error.go fix(proxy): fail fast with a clear MySQL error when an external upstream is unreachable (#7181) 2026-10-04 02:37:58 -07:00
upstream_error_test.go fix(proxy): fail fast with a clear MySQL error when an external upstream is unreachable (#7181) 2026-10-04 02:37:58 -07:00