Skip to content

fix(proxies): shorten refused-egress set-aside and rest slow egress - #14891

Merged
diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/refusal-setaside-tuning
Sep 28, 2026
Merged

diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/refusal-setaside-tuning

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14963

Summary

Default change: PROXY_QUOTA_429_BASE_MS 120s → 300s, PROXY_QUOTA_429_MAX_MS 3600s → 900s — a refused egress rarely recovers within minutes, while the lower cap lets a recovered member return within the quarter-hour.
Repeatedly refused egresses were parked for up to an hour, and egresses stalling on response headers were never rested at all. This PR shortens the refused-egress curve to 300s → 600s → 900s and adds a short 60s/600s slow curve that sets an egress aside after three settled headers-waits in five minutes under the same opt-in flag; the pool screen labels that motive ("slow responses") instead of printing the raw kind. Three existing default tests were adapted to the new values.

Related Issues

  • No linked issue — no public issue tracks this tuning.

Validation

  • Change type: routing
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/proxy-slow-overrun.test.ts (new): k=3/W=5min gating, lone/pair without effect, null key, flag off, expired window, served-clears-slow, 60s/600s curve, 20min purge, store size.
  • tests/unit/proxy-refusal-memory.test.ts (adapted): curve 5/10/15/15min, purge 29/30min.
  • tests/unit/proxy-refusal-memory-quota-tuning.test.ts (adapted): default periods and fallback expectations.
  • tests/unit/opencode-proxy-refusal-memory.test.ts (adapted): a refused member is still set aside after the former 2-minute default and returns after 5 minutes.
  • tests/unit/ui/PoolMemberEgressLines.test.tsx (1 new case): a slow set-aside is labelled, never printed raw.

Coverage Notes

The new store counter, gated helper, and expiry call site in open-sse/ are exercised by the new slow-overrun tests, and the adapted tests pin the new default curve; the two widened reason unions are type-only with no runtime path.

Reviewer Notes

Maintainer rework (merge-batch 2026-09-28)

  • Confirmed that the rebase pushed after the first review changes no content. The patch matches the one already validated.
  • Updated .env.example so the PROXY_QUOTA_429_MAX_MS example shows the new 900000 cap instead of the old 3600000.
  • Merged release/v3.8.51 into the branch (real merge, no conflicts).
  • Validation on the merged head: the 4 refusal-memory and slow-overrun suites pass 43/43, and PoolMemberEgressLines passes 7/7 under vitest. typecheck:core, check:open-sse-typecheck, eslint (with the suppressions file) and check:env-doc-sync are all clean. The two check-file-size reds (SystemStorageTab.tsx and response-sanitizer.test.ts) are inherited from the tip; this PR does not touch either file.

Refused egresses were parked up to an hour and slow egresses never rested.
Shortens the refused curve and adds a short slow curve on repeated
headers-wait overruns.
@maxmad64bis
maxmad64bis force-pushed the fix/refusal-setaside-tuning branch from 3eca790 to e8c8f9c Compare September 28, 2026 17:56
@diegosouzapw
diegosouzapw merged commit 99bd98a into diegosouzapw:release/v3.8.51 Sep 28, 2026
2 of 3 checks passed
diegosouzapw pushed a commit that referenced this pull request Sep 28, 2026
The selector is now steered to pool members with no recent refusals, reusing the refusal curve from #14891 (merged first). The author's rebase changes no content (patch identical to the one already validated). Validated on the tip that includes #14891: the selector refusal-memory, refusal-memory and proxySubscription suites pass 165/165. typecheck:core, open-sse typecheck and eslint are clean; the file-size reds are inherited from the tip. Thank you @maxmad64bis!
@maxmad64bis
maxmad64bis deleted the fix/refusal-setaside-tuning branch September 30, 2026 00:22
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