Repository navigation
test(ci): #299/#300 deep diagnosis — fail-fast DB timeouts + live pg snapshot + graceful-teardown gate - #302
Merged
Merged
Conversation
- #299 fail-fast: runtime test config injects lock_timeout=3s, idle_in_transaction_session_timeout=60s (connect_options) and drogon sql-timeout=30s; drogon timeout=-1 made the client-side sqlCmdBuffer_ a time-unbounded queue (null-resp signature), and infinite lock waits stacked silently behind statement_timeout. - #299 evidence: DbDiagnostics.h out-of-pool pg_stat_activity / pg_blocking_pids / ungranted-locks snapshot at the exact double-null moment (sendWithRetry hook) + steady-clock timestamps on every login diagnostic print; every silent nullopt path in loginAsUserTokensOnce / loginTokenVerbose now prints status+body. - #300: FULLA_TEST_GRACEFUL_TEARDOWN=1 env gate takes the graceful quit+join path (the one that segfaults instrumented builds) so an ASan run can capture the UAF stack.
This was referenced Nov 2, 2026
added 2 commits
November 2, 2026 18:18
…lients Per-request clients opened ~1800 fresh loopback connections per suite run; the captured wedge evidence shows the server sporadically accepts a connection and never services it (CLOSE-WAIT + epoll-idle loops + zero kernel drops), burning 2x30s HTTP timeouts = the ~61s null-resp outage. A pool kills the churn without the 5x serialization of the single-shared-client experiment.
…t path keeps the connection)
voidvec
marked this pull request as ready for review
November 3, 2026 01:08
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Deep-dive + fix for #299 (one rotating login null-resp per full-suite run) and #300 (teardown use-after-free behind the fast-exit). Both root causes captured with hard evidence; the #299 flake is fixed.
#299 — root cause chain (all hypotheses tested against captured evidence)
Working method: fail-fast DB settings + an out-of-pool
pg_stat_activitysnapshot fired at the exact failure moment (tests/common/DbDiagnostics.h), steady-clock timestamps on every silent failure path, plus a local WSL CI-parity repro lab (2-CPU taskset, threads=4, fresh DB per run, pre-applied migrations).Refuted by evidence (each was the leading theory at some point):
idle, zero locks, zero transactions (xact_age NULL everywhere).timeout:-1(unbounded client-sidesqlCmdBuffer_) is what converts any stall into an infinite null-resp.Captured root cause (thread stacks via gdb attach mid-wedge + socket state + kernel counters):
login_successaudit inserts, self-healing afterwards. 61s = the test client's own 2×30s HTTP timeouts + retries.epoll_wait(fully idle), DB fully caught up, client thread blocked insendRequest's futex — andssshows 4 CLOSE-WAIT + ~1800 TIME_WAIT with all kernel drop/overflow counters at zero.Fix (test-side, this PR): a round-robin pool of 8 keep-alive
HttpClients replaces per-request clients — ~200× smaller fresh-accept surface, no TIME_WAIT churn, no serialization (the old single-shared-client experiment serialized the suite ~5×). Companion:discardTestHttpClient()— drogon's timeout path keeps a possibly-dark connection (only the connect-error path resets it), so any transport failure swaps the slot for a fresh client.Validation: 12/12 clean local full-suite runs (previously ~⅓ wedged; suite also ~2× faster), and this PR's CI legs — including the linux leg that failed with the flake on the diagnostics-only commit and the ASan full-suite leg — are all green.
Residual (filed separately): the server-side accept-but-never-service bug itself lives in drogon/trantor territory; with the pool, exposure is gone but the underlying behavior is tracked in a follow-up issue with the captured evidence.
#300 — teardown UAF pinned (diagnostics only; fast-exit stays)
FULLA_TEST_GRACEFUL_TEARDOWN=1takes the graceful quit+join+return path on purpose. Under ASan+UBSan it reproduced deterministically at the static-destructor phase:The fast-exit remains correct (it skips
__run_exit_handlersentirely). Paste-ready upstream report:deliverables/drogon-upstream-issue-300-teardown-uaf.md(local) — needs a token with public-repo issue scope to file.Also in this PR
lock_timeout=3s,idle_in_transaction_session_timeout=60s, drogon SQLtimeout=30— the last one converts any future pool/queue stall into an attributable 500 instead of an infinite null.loginAsUserTokensOnce/loginTokenVerbosenow prints status+body+t+ms (the CI tail cluster previously hid which path bit).Test plan