Skip to content

fix: reject throttler queue overflow#877

Merged
realfishsam merged 7 commits into
mainfrom
fix/issue-690-throttler
Jun 8, 2026
Merged

fix: reject throttler queue overflow#877
realfishsam merged 7 commits into
mainfrom
fix/issue-690-throttler

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Reject new throttle requests once the queue reaches its maximum depth instead of silently resolving the oldest waiter.

Tests

  • npm test --workspace=pmxt-core -- --runInBand test/utils/throttler.test.ts

Fixes #690

@realfishsam

realfishsam commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Makes throttler queue overflow reject callers immediately instead of leaving pending promises. Consumers benefit on any rate-limited path under queue pressure.

Blast Radius

Shared core throttler utility and tests; all exchange/server code using the throttler may be affected.
Changed files reviewed: core/src/utils/throttler.ts, core/test/utils/throttler.test.ts

Consumer Verification

Before (base branch):
Base branch (origin/main) does not include these changes. I reviewed the diff against the base and did not run full live-exchange before/after reproduction in this daily batch.

After (PR branch):
PR branch build PASS; authenticated local sidecar smoke PASS using POST /api/mock/fetchMarkets with x-pmxt-access-token, response snippet: {"success":true,"data":[{"marketId":"mock-m0","eventId":"mock-event-0","title":"Which party wins the 2026 harborland election?","description":"incididunt magna metus ut cupidatat aliquip dolore quis incididunt id do aenean aenean non dolor dolore tempor pharetra lorem fugiat aenean est voluptate ...

Test Results

  • Build: PASS (npm run build --workspace=pmxt-core)
  • Unit tests: PASS (npm test --workspace=pmxt-core -- --runInBand)
  • Server starts: PASS
  • E2E smoke: PASS (POST /api/mock/fetchMarkets; live venue-specific calls were not made)
  • Dependency install: skipped (existing workspace deps reused)

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: N/A
  • Type safety: ISSUE
  • Auth safety: N/A

Semver Impact

patch -- bug fix/internal compatibility change unless SDK consumers rely on newly added APIs

Risk

The branch was built, core-tested, and authenticated-smoke-tested through the sidecar. Full live-exchange before/after behavior remains unverified for this daily batch; credentialed venue calls and venue API drift should be treated as residual risk unless covered by tests in this PR.

@realfishsam realfishsam merged commit 62a38ab into main Jun 8, 2026
11 checks passed
realfishsam added a commit that referenced this pull request Jun 8, 2026
Covers everything between 2.48.6 and HEAD plus the hosted-trading-mode
work on this branch — Added (7 bullets: hosted trading mode end-to-end,
Escrow namespace, hosted error hierarchy, 2 e2e drivers, 87 new
dispatch + error-mapping tests, feed listing surface), Changed (9
bullets: SDK 2.18.0 version bumps, new model fields, drift parity
sweep, dep refreshes), Fixed (12 bullets covering both the
hosted-mode bugs caught by the live $5 buy + sell and the unrelated
fixes that landed on main since 2.48.6 — #871 #870 #873 #874 #875 #876
#877 #879 #663 #872 + the three this branch adds), Docs (2 bullets).
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.

Unbounded: core/src/utils/throttler.ts — queue overflow silently resolves dropped requests, bypassing rate limiting

1 participant