temporal
temporal copied to clipboard
Some persistence callers have no deadline, so they stay blocked on a silent Postgres connection
Follow-up to #12246, outside the shard io semaphore that #12441 covers.
Expected Behavior
Persistence calls end once a bounded deadline passes.
Actual Behavior
Three background callers pass no per-call deadline, so on a connection that goes silent without a reset they can stay blocked on either driver:
nsregistry.(*registry).refreshNamespaces(starts fromcontext.Background())ringpop.(*monitor).upsertMyMembership(lifecycle context)- matching
taskManagerImpl.CreateTasks(WithCancel(Background()))
In my #12246 repro with postgres12_pgx, the matching writer still stalled and workflows stopped. With lib/pq, calls that do have a deadline block too (lib/pq#620).
Steps to Reproduce the Problem
- Run the server against Postgres through HAProxy with a steady workflow load.
- Black-hole established client connections without a reset.
- Dump goroutines after a few minutes.
Specifications
- Version: main 5a78ff3a1 (lib/pq); earlier #12441 build (pgx, unload off)
- Platform: macOS arm64, Docker Desktop, Postgres 16
I'd add per-call deadlines to those three callers and a docs note recommending postgres12_pgx for PostgreSQL. OK to send a PR?