Bound Seqera executor scheduler requests with a request timeout - #7466
Draft
pditommaso wants to merge 1 commit into
Draft
Bound Seqera executor scheduler requests with a request timeout#7466pditommaso wants to merge 1 commit into
pditommaso wants to merge 1 commit into
Conversation
The Task monitor thread could block indefinitely inside describeTask() on a stalled scheduler response: only the connect phase was bounded, never the wait for the response. A single hung poll stalls checkAllTasks() for the whole session. Add seqera.executor.requestTimeout (default 45 sec), applied to each attempt. A timed-out read raises an IOException that the configured retryPolicy absorbs, so polling recovers on the next cycle instead of failing the task. Task submissions are never re-sent by the client, so a bounded submit fails rather than duplicating tasks. Requires sched-client 0.78.0, which decouples the request timeout from the attempt count and pins non-idempotent requests to a single attempt. On 0.73.2 a configured timeout silently disabled retries for every call. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7435.
Draft: blocked on a
sched-clientrelease. This bumps the pin from0.73.2to0.78.0, which is not published yet — see the dependency section below.What this fixes
The
Task monitorthread can block indefinitely insideSchedClient.describeTask()on a stalled scheduler response. Only the connect phase was bounded (10s, set insidesched-client); nothing bounded the wait for the response body once the connection was established. BecauseTaskPollingMonitorpolls all tasks from that single thread, one hung poll stallscheckAllTasks()for the entire session — no task in the run advances.What changes
A new config option, applied to every request the executor's client issues:
It bounds a single attempt, not the whole call. A timed-out read raises
HttpTimeoutException, which extendsIOException— exactly whatseqera.executor.retryPolicy(default 10 attempts, 450ms initial delay, exponential to 90s) exists to absorb. So a slow poll is retried rather than propagated intocheckAllTasks(), where it would fail the task instead of being picked up on the next 10s cycle.0 secrestores the previous unbounded behaviour.Why task submission is not at risk
POST /v1a1/compute/tasksis not idempotent — the scheduler mints fresh task ids per delivery and has no idempotency key — so a re-sent batch submit would create a duplicate set of tasks whose idsSeqeraBatchSubmitter.flushBatch()never learns, and which nothing polls or cancels.sched-client0.78.0 pins every non-idempotent request to a single attempt for exactly this reason (seqeralabs/sched#1033), with the server-side fix tracked in seqeralabs/sched#1031. A bounded submit therefore fails cleanly throughonBatchSubmitFailure()rather than duplicating work.One consequence worth knowing: a submit that fails with connection refused — a draining scheduler pod during a rolling deploy — is no longer retried either, because the client cannot distinguish "nothing was delivered" from "delivered and processed". That is lifted once the submit endpoints accept an idempotency key.
Dependency
sched-client0.73.2 → 0.78.0, required for correctness rather than for the API:requestTimeoutexists in 0.73.2, but setting it there silently forcedmaxAttempts(1)and discardedretryPolicyfor every call, so a single timed-out poll would fail the task — the opposite of what this PR is for. The decoupling landed in seqeralabs/sched#937.Note this plugin overrides
lib-httpxto 2.4.0 while sched pins 2.2.0; the client behaviour relied on here (default retry conditionthrowable instanceof IOException, and the per-request timeout being re-applied on each attempt because the sameHttpRequestis re-sent) is identical in both.Ready to un-draft as soon as 0.78.0 is on the Seqera Maven repo.
Tests
ExecutorOptsTest— the 45s default and an explicit value round-trip through the config scope.SeqeraExecutorTest— an explicit timeout reachesSchedClientConfig, and0 secmaps tonull(unbounded).:plugins:nf-seqera:testfor both classes — 52 tests, 0 failures.🤖 Generated with Claude Code