Skip to content

Rerun Seqera tasks the scheduler marks retryable as new tasks - #7933

Merged
pditommaso merged 8 commits into
masterfrom
task/nf-seqera-rerun-a-sched-task-marked-retr-998
Oct 27, 2026
Merged

pditommaso merged 8 commits into
masterfrom
task/nf-seqera-rerun-a-sched-task-marked-retr-998

Conversation

@jordeu

@jordeu jordeu commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a Fusion snapshot restore fails, rerunning the task in the same work dir can hit stale state left by the failed attempt. The Seqera scheduler now fails such a task and marks it retryable, and Nextflow must rerun it in a new work dir. This PR makes the Seqera executor do that whatever the pipeline's errorStrategy says, up to the maxRetries directive. Core code is unchanged: the existing ProcessRetryableException path does the rerun.

Changes

nf-seqera

  • SeqeraTaskHandler keeps the whole DescribeTaskResponse, not only taskState, so it can read the new optional retryable and retryReason fields.
  • When a task is FAILED, retryable is true and task.failCount < maxRetries, task.error is set to a new SeqeraRetryableException, a ProcessRetryableException. TaskProcessor.resumeOrDie then increments failCount and reruns the task in the next work dir, outside errorStrategy, as it already does for K8s node terminations. The reason, exit code and error message are logged.
  • After maxRetries reruns, or when the scheduler doesn't send the field, the exit code goes through errorStrategy as before.
  • task.aborted is deliberately not set, unlike in K8sTaskHandler. makeCopy() would carry the flag over, and a rerun that succeeded would be reported as ABORTED and not treated as cached on -resume.
  • io.seqera:sched-client bumped to 0.111.0-SNAPSHOT, which adds DescribeTaskResponse.retryable and retryReason (the 0.111.0 release does not include them).

docs

  • New "Infrastructure failures" section in the Seqera executor reference (docs/reference/executor/seqera.mdx): reruns in a new work dir, how they count towards maxRetries and task.attempt, and how to allow more reruns.

Behaviour

An infrastructure rerun counts as one of the user's maxRetries (default 1) and raises task.attempt for a later real failure, the same as K8s node terminations today.

Before merging

  • Replace the sched-client SNAPSHOT with a release that includes the new fields.
  • Run an end-to-end test against a scheduler build that returns the new fields.

Tests

  • SeqeraTaskHandlerTest: covers retryable (first and last rerun), at the cap with and without an exit code, retryable false or absent, and SUCCEEDED.
  • TaskProcessorTest: a ProcessRetryableException cause reruns the task regardless of errorStrategy, incrementing failCount (the core path had no test).

nf-seqera: when the scheduler reports a FAILED task with `retryable=true`
(e.g. a failed Fusion snapshot restore, exit 175/177), fail it with a
ProcessRetryableException so it is rerun as a new task in a new work
dir, regardless of errorStrategy. Capped at 3 reruns, then the exit
code goes through errorStrategy. A missing field keeps the old path.

core: count these reruns in a new `TaskRun.rerunCount` instead of
`failCount`, so they don't spend maxRetries nor bump task.attempt
(also applies to K8s node termination and spot retries).

Signed-off-by: Jordi Deu-Pons <jordi@jordeu.net>
@netlify

netlify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nextflow-docs ready!

Name Link
🔨 Latest commit 81d09e9
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs/deploys/6ae0a79d0fb6b7dcb4e9d5b7
😎 Deploy Preview https://deploy-preview-7933--nextflow-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jordeu
jordeu marked this pull request as ready for review October 27, 2026 06:42
@pditommaso
pditommaso self-requested a review October 27, 2026 11:57
pditommaso and others added 6 commits October 27, 2026 13:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Replace the hardcoded MAX_RETRYABLE_RERUNS with the task maxRetries
directive, and cover the fallback to errorStrategy when the cap is
reached and the scheduler reports no exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
…ci fast]

Keep sched-client 0.111.0-SNAPSHOT: the 0.111.0 release does not include
DescribeTaskResponse.retryable and retryReason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
The retryable branch of TaskProcessor.resumeOrDie already increments
failCount and so reruns the task in a new work dir. Drop the new
TaskRun.rerunCount and the related core changes, cap the reruns on
failCount against maxRetries, and inline the retry check in
SeqeraTaskHandler.checkIfCompleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
…fast]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
pditommaso requested a review from a team as a code owner October 27, 2026 13:17
@pditommaso
pditommaso merged commit ed1a165 into master Oct 27, 2026
25 of 26 checks passed
@pditommaso
pditommaso deleted the task/nf-seqera-rerun-a-sched-task-marked-retr-998 branch October 27, 2026 13:48
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