summaryrefslogtreecommitdiffhomepage
path: root/packaging/[email protected]
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-28 14:50:27 +0900
committerAdam Malczewski <[email protected]>2026-06-28 14:50:27 +0900
commitfb4a9217b55dd3ba11670104ac23536416d36940 (patch)
tree4ae4aed5ca1bbc09620e0ab53e54cf54b5cbd2f2 /packaging/[email protected]
parentdf7d45b58076b6ab47bea3148872cac11401d510 (diff)
downloaddispatch-fb4a9217b55dd3ba11670104ac23536416d36940.tar.gz
dispatch-fb4a9217b55dd3ba11670104ac23536416d36940.zip
fix(concurrency): usage-gate fast-path overshoot + fetchUsage rejection safety + persist auto-reduce notice
Bug 1 (overshoot): acquire() fast-path now queues while a recycle-poll is in flight (gatePolling), and the recycle defers its inFlight decrement until the usage poll resolves — holding inFlight inflated through the poll window so a concurrent caller cannot sneak through before upstream confirms room. The gated path admits exactly one waiter per fresh poll (grantOne), robust against stale upstream counts. Common-case throughput preserved: the fast-path still grants immediately when no poll is in flight. Bug 2 (unhandled rejection): fetchUsage is wrapped in safeFetchUsage — a throwing getUsage() is caught, treated as undefined (cooldown-only fallback), and reported via the new onUsagePollError opt (warn-level). No unhandled promise rejection can crash the process. Bug 3 (lost notice): loadLimits now calls restoreLimit (a new lower-level state-seeding method that does NOT clear autoReduced) instead of setLimit (which is a manual user action that clears the notice). The auto-reduce marker (autoReducedFrom) is persisted under auto-reduce:<providerId> and restored on activate via loadAutoReduce, so the frontend banner survives a restart. +6 tests covering each bug.
Diffstat (limited to 'packaging/[email protected]')
0 files changed, 0 insertions, 0 deletions