You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
4.x: Unify throttler permit release across request handlers #1228
Every request handler returns its throttler permit "exactly once", but each one does it differently:
CqlRequestHandler: an admitted flag, a registrationComplete flag, a throttlerReleased CAS, and a saved terminalError
GraphRequestHandler and CqlPrepareHandler: whichever completeExceptionally wins, a CancellationException carve-out, and the exceptionally hook
ThrottledAdminRequestHandler: the admitted flag only
ContinuousRequestHandlerBase: the return value of abortGlobalRequestOrChosenCallback and the cancel listener
After #1007 the handlers already behave differently. Only CqlRequestHandler defers a release when a timeout races register(), and only it returns early from onThrottleReady() when the result is already complete. GraphRequestHandler and CqlPrepareHandler still record THROTTLING_DELAY and build a query plan for a request that timed out or was cancelled while its ready callback was pending. That is harmless today only because sendRequest() checks result.isDone().
Every review round of #1007 found the same defect again in a sibling handler.
Expected behavior
One small shared helper handles the permit for every handler: it marks the request admitted, releases the permit once, and chooses signalTimeout, signalCancel or signalError from the result's state. Every handler uses it, so #949, #1013 and #1014 build on one tested mechanism.
Activity