Skip to content

019faf74 - Reject slow missing-trigger gs/db requests - #4476

Merged
TaprootFreak merged 1 commit into
developfrom
fix/gs-db-fast-trigger-rejection
Jul 29, 2026
Merged

019faf74 - Reject slow missing-trigger gs/db requests#4476
TaprootFreak merged 1 commit into
developfrom
fix/gs-db-fast-trigger-rejection

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

What

  • Reject missing trigger values synchronously in both POST /gs/db and POST /gs/db/custom.
  • Keep the audit log before the rejection and preserve the existing Process.GS_DB endpoint kill switch.
  • Remove the per-request SettingService lookup and the obsolete gsTriggerEnforcement schema entry.
  • Update controller tests for both handlers, valid Manual/Auto calls, the audit-before-reject invariant, and the sub-one-second rejection budget.

Why

Production traces showed that the reported ~2.4 s rejection was not caused by parsing the request body: sampled bodies were small and validation took well below a millisecond. Almost the complete delay was spent awaiting the uncached gsTriggerEnforcement database read under burst load.

Enforcement is already active, and missing-trigger requests must now always be rejected. Keeping a database lookup on every rejected call makes the error path contend for the same application and connection resources it is intended to protect.

Impact

Requests without trigger receive 400 Trigger type is required without any database/cache await before the throw. Requests declaring Manual or Auto keep their existing behavior. The former gsTriggerEnforcement setting no longer controls this requirement; the existing Process.GS_DB switch can still disable the endpoints during an incident.

No migration is required.

Validation

Validation and independent review are in progress while this PR remains a draft.

@TaprootFreak
TaprootFreak marked this pull request as ready for review July 29, 2026 20:40
@TaprootFreak
TaprootFreak merged commit 3a6ab1c into develop Jul 29, 2026
12 checks passed
@TaprootFreak
TaprootFreak deleted the fix/gs-db-fast-trigger-rejection branch July 29, 2026 20:40
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