Skip to content

GH Issue 1875: Keep diagnostic thread dumps from blocking on locks or connections - #8391

Open
labkey-jeckels wants to merge 5 commits into
developfrom
fb_thread_dump_hang_1875
Open

labkey-jeckels wants to merge 5 commits into
developfrom
fb_thread_dump_hang_1875

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Writing a diagnostic thread dump after a lock timeout must never wait on an application lock or a pooled connection, so a deadlock breaks within the lock timeout instead of hanging the server (GH Issue 1875). Previously every timed-out thread queued behind one synchronized dump, and that dump's Postgres locks and activity query could block for minutes on the container cache lock and the connection pool, eventually exhausting the pool.

Changes

  • Thread dumps triggered automatically by lock timeouts and transaction errors are skipped when another dump is already in progress; explicitly requested dumps still wait their turn.
  • The Postgres locks and activity section of a dump now queries over its own short-lived connection with short timeouts, bypassing the connection pool and query layer, so it can't wait on the deadlocked threads and still works when the pool is exhausted or the dumping thread's transaction has aborted.
  • Added an integration test confirming a lock timeout doesn't wait behind a dump in progress.

… connections

Lock-timeout dumps now skip when another dump is in progress, and the Postgres section is skipped rather than waited on when the root container isn't cached or no pooled connection is free.
@labkey-jeckels
labkey-jeckels marked this pull request as draft November 26, 2026 00:41
@labkey-jeckels labkey-jeckels self-assigned this Nov 26, 2026
@labkey-jeckels
labkey-jeckels marked this pull request as ready for review November 29, 2026 22:46
@labkey-jeckels
labkey-jeckels requested a review from a team November 29, 2026 22:46
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.

2 participants