Repository navigation
Conversation
|
Unsigned commits detected! Please sign your commits. For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation. |
request-timeout bounds one inference attempt, but the send context is min(now + request-timeout, request deadline), and any DeadlineExceeded on it was reported as a terminal DEADLINE_EXCEEDED result. a request with a 24h deadline whose attempt hit the 5m default timeout was finished as deadline exceeded 23h55m early, and counted in the exceeded deadline metric. only finish the request as DEADLINE_EXCEEDED when its own deadline has passed. otherwise the attempt goes down the retry path like any other transport timeout, the same way a gate-wait timeout is already recoverable. Signed-off-by: Dundy Pasupuleti <dundysm@gmail.com>
38168e6 to
37bcfcf
Compare
|
@shimib could you take a look when you have a moment? the send path still turns a request-timeout abort into a terminal DEADLINE_EXCEEDED even when the request deadline is hours away, unlike the gate-wait timeout from #426. i noted an alternative in the description if you would rather keep a timed-out attempt terminal. |
|
Thanks for this. Before it can be reviewed for merge, the commit needs a verified signature: the Could you sign the commit and force-push? |
|
I'd keep the retry, not the terminal alternative. It matches the gate path (#426) and the transform path, which since #587 retries an attempt cut off by Two requests:
Not for this PR: after such a run the final result is a bare |
What does this PR do?
a send that
request-timeoutcuts off while the request's own deadline is still ahead now goes down the retry path instead of ending as a terminalDEADLINE_EXCEEDEDresult. a request is only finished asDEADLINE_EXCEEDEDonce its deadline has actually passed.Why is this change needed?
the worker bounds each send with
reqDeadline = min(now + request-timeout, request deadline)(pkg/asyncworker/worker.go), and since #394 anycontext.DeadlineExceededon that context is reported asDEADLINE_EXCEEDED:that check cannot tell which of the two bounds fired. with the default
request-timeoutof 5m, a batch request with a 24h deadline whose attempt hangs for 5m (a stuck replica, a slow gateway queue) is finished as deadline exceeded about 23h55m early, never retried, and counted in the exceeded deadline counter (ExceededDeadlineReqs). the caller gets a result that says its deadline passed when it did not.the gate path already makes this distinction since #426: a gate-wait timeout is recoverable and "only the request's public deadline" is terminal (
requestDeadlineReached). and a timeout raised inside the http client is already retried, becausetransportErrorCategoryclassifiesTimeout()errors asErrCategoryServer. the send-context timeout was the one case left that skipped both.with this change the check is
errors.Is(reqCtx.Err(), context.DeadlineExceeded) && requestDeadlineReached(msg.PublicRequest, time.Now()). when the deadline is the bound that fired, behaviour is unchanged (TestDeadlineAbortedSendClassifiedAsDeadlineExceededstill passes). whenrequest-timeoutfired first, the error is the client'sErrCategoryServertransport timeout, soretryMessagere-enqueues it with backoff, and if the deadline is spent by then it still emitsDEADLINE_EXCEEDEDfrom there.one tradeoff worth calling out: a generation that legitimately runs longer than
request-timeoutis now retried until its deadline instead of failing after the first attempt. that matches whatrequest-timeoutis documented as (a per-request inference timeout, not a lifetime), and such deployments already needed a largerrequest-timeoutto get any result. if you would rather keep a timed-out attempt terminal, the alternative is to keep it fatal but report it as an inference error instead ofDEADLINE_EXCEEDED; happy to switch to that.How was this tested?
TestRequestTimeoutasserted the old terminal outcome (its comment says the timeout error isErrCategoryUnknown, which stopped being true whentransportErrorCategorylanded). it now runs a 100msrequest-timeoutagainst a request 100s from its deadline and checks the message is re-enqueued withRetryCount1 and a positive backoff, the client was called once, and the exceeded deadline counter did not move. on main it fails:with the fix
go test ./pkg/... ./pipeline/... ./api/...passes, andgo vet ./pkg/asyncworker/andgofmtare clean, andhack/lint-release-notes.shpasses on the fragment inrelease-notes.d/unreleased/584.md. i did not run the e2e suite (needs a cluster).docs/deployment.mdnow saysrequest-timeoutbounds one attempt and that only the deadline ends a request asDEADLINE_EXCEEDED.Checklist
git commit -s) per DCOmake test) (rango test ./pkg/... ./pipeline/... ./api/...instead)make lint)Related Issues
related to #394, #426, #103
Release note