Skip to content

fix(ci+plugin): first-nightly triage — ctest lookahead never matched (coverage gate green); admin-scope handshake race; tsan suppressions - #320

Merged
voidvec merged 4 commits into
masterfrom
fix/nightly-first-run
Nov 9, 2026

Conversation

@voidvec

@voidvec voidvec commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Both nightlies fired for the first time on 2026-11-08 (~7h GitHub schedule delay on new cron triggers — expected) and both failed. This PR lands the triage of everything they exposed, verified by re-dispatch on this branch.

Finding 1 — the coverage gate's "everything else" ctest filter NEVER matched (fixed)

-R "^(?!.*OAuth2Tests).*$" — ctest's regex engine (cmsys) cannot compile negative lookahead: RegularExpression::compile(): ?+* follows nothing, zero tests matched, "No tests were found!!!", exit 0. The 512 non-monolithic tests (every Contract repository test) never executed on ANY coverage run since the pattern's introduction; the ratchet read the missing library-layer data as regressions (identity 87.1→63.0, oauth2 88.8→74.4 — matching the v1.6.0 partial-data signature exactly, now explained). Fix: POSIX-safe ctest -E '^OAuth2Tests$'.

Verified (dispatch, run 42550974545): full suite 597/597 passed in 174.5 s + OAuth2Tests 55.9 s — and [ratchet] OK: no library dropped more than 0.5pp below baseline. The 2026-09-05 baseline was accurate all along; no re-baselining. (Also proves the gcov suite is FAST on current master — the "cannot sustain the full suite" premise described the pre-#302 DB-timeout era.)

Finding 2 — tsan-nightly's first genuine run ever: a bug harvest (two layers triaged, backlog documented)

The job had been dispatch-only since creation; the suppression file its own policy references never existed.

  • Layer 1 (suppressed with per-race evidence): trantor EventLoop::wakeup() cross-thread eventfd + MpscQueue producer-side std::function move — upstream, queue/fd publication protocol is the intended synchronization. New tools/sanitizers/tsan.supp.
  • Layer 2 — FIRST-PARTY race, FIXED not suppressed: OAuth2Plugin::initAndStart issues the admin-scope DB load at :75 (initStorage) but constructs authorizationService_ ~150 lines later — the DbLoop callback read the member unsynchronized, and its if (authorizationService_) guard silently dropped the DB-loaded set when the callback won the race (non-default deployments would gate on the hardcoded fallback set — wrong authorization semantics, latent since the plugin's inception). Fix: mutex-ordered handshake (pendingAdminScopes_ stash + flush under adminScopesMu_ at the construction site).
  • Layer 3 (suppressed with evidence): drogon HttpRequestImpl dtor clearing headers vs trantor::Connector::handleWrite during smoke-host teardown — all frames upstream.

Remaining backlog (honest): the third dispatch still fails on further findings (hashtable-_M_begin / shared_count ctor / vector-size races — attribution pending). tsan-nightly is a schedule-gated nightly, not a PR gate, so it stays red until its own follow-up triage pass — exactly the "cannot be made green within budget" branch the workflow policy documents. The harvest so far: 1 real authorization-semantics bug fixed, 3 upstream races documented.

Verification

  • coverage dispatch on this branch: gate leg green, ratchet OK (numbers above)
  • sanitizer dispatch on this branch: ASan+UBSan green (the PR gate for this file); tsan improved from 2 findings → new layers, triage continues on master nightlies
  • PR CI: the standard matrix

Type of change

  • Bug fix (non-breaking) — the plugin race fix
  • CI fix

Checklist

  • Tests: the full matrix is the coverage; the plugin fix is exercised by every integration boot
  • CHANGELOG entry added (Unreleased → Fixed, plugin race)
  • Docs N/A (workflow comments carry the evidence)

…tsan suppressions for trantor races

Both nightlies fired for the first time 2026-11-08 (new cron triggers,
~7h GitHub schedule delay) and both failed. Root causes are INHERITED
defects the first real runs exposed:

1. Coverage gate leg (run 42472349551): the 'everything else' ctest
   filter -R '^(?!.*OAuth2Tests).*$' NEVER matched anything — ctest's
   regex engine (cmsys) cannot compile negative lookahead ('?+*
   follows nothing'), it matched zero tests, printed 'No tests were
   found!!!' and still EXITED 0. The 512 non-monolithic tests (every
   Contract repository test included) never executed on ANY coverage
   run since the pattern's introduction; the ratchet then read the
   missing library-layer data as regressions (identity 87.1->63.0,
   oauth2 88.8->74.4, common 74.3->66.1 — matching the v1.6.0-era
   partial-data signature exactly, now explained). Fix: POSIX-safe
   ctest -E '^OAuth2Tests$' exclude flag; evidence recorded in a
   comment at the call site.

2. tsan-nightly (run 42469207432): first genuine TSan run ever (the
   job had been dispatch-only since creation — the referenced
   suppression file never existed). Both findings are trantor-internal
   (Drogon's event-loop library): EventLoop::wakeup()'s cross-thread
   eventfd write vs createEventfd() setup, and MpscQueue's producer-
   side std::function move vs consumer read — the queue's publication
   protocol is the intended synchronization. Per the workflow's own
   triage policy these get documented suppressions: new
   tools/sanitizers/tsan.supp (per-race evidence + dated + the
   first-party-findings-are-fixed-not-suppressed rule), wired into
   TSAN_OPTIONS at both the job and ctest-step scopes via a
   workspace-absolute path.

Verification: workflow_dispatch of both workflows on this branch —
the gate leg now runs the full 513-test suite (ratchet verdict on
complete data), tsan re-runs with suppressions to surface whatever
genuine findings remain.
…m connector-teardown race

First tsan-nightly findings, round 2 (after the trantor suppressions
took effect):

1. FIRST-PARTY race in OAuth2Plugin (fixed, not suppressed): initAndStart
   issues the admin-scope DB load via initStorage at :75, but constructs
   authorizationService_ ~150 lines later — the DbLoop callback
   (OAuth2Plugin.cc:718) read the member unsynchronized AND its
   if (authorizationService_) guard silently DROPPED the DB-loaded set
   when the callback won the race, falling back to the hardcoded default
   set (wrong admin-gate semantics for any deployment with non-default
   oauth2_scopes.requires_admin_role rows). Fix: mutex-ordered handshake
   — the callback stashes the set as pendingAdminScopes_ when the service
   does not exist yet; the construction site assigns the member AND
   flushes the stash under the same lock. IdentityService's static
   admin-class set is updated before the lock (unchanged behavior).

2. Upstream race suppressed with evidence (drogon/trantor frames only on
   both stacks): HttpRequestImpl dtor clearing the headers map vs
   trantor Connector::handleWrite still reading it during the full-stack
   smoke host teardown. tools/sanitizers/tsan.supp extended (#3); the
   triage-policy footer now points at this commit's first-party fix as
   the example of fix-not-suppress.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T04:09:59.872136Z
We couldn’t complete this review. Comment @codex review to try again.
f9bc802 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@voidvec
voidvec merged commit 571dc29 into master Nov 9, 2026
13 checks passed
@voidvec
voidvec deleted the fix/nightly-first-run branch November 9, 2026 05:12
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.

1 participant