Skip to content

Conversation

@johnoooh
Copy link

Currently, TaskArrayCollector submits a job array only when the array reaches its configured size. In pipelines with slower task generation or variable workloads, small batches may remain in memory indefinitely if the array never fills, delaying execution. This is especially a problem in pipelines with hanging channels, like channels made by watchPath. We have a few pipelines that run forever, watching a samplesheet for new entries, and processing them as they come in. We would like to use array jobs to reduce strain on the slurm scheduler as much as possible as this has been a problem on our cluster.

My proposal is to create a maximum amount of time to wait for more jobs before submitting the array of jobs. Then the pipeline would work like this:

The first 10 jobs are submitted as an array job as expected. The next 6 jobs are added into the task array. Then, the time specified by executorSubmitTimeout elapses. At this point the remaining 6 jobs are put into a job array and submitted to the cluster.

Discussion of this feature was originally started here:
#5924

Then I further described the issue here: #6465

I'm currently having an issue with java.util.ConcurrentModificationException when running hundreds of jobs.

johnoooh and others added 13 commits October 9, 2025 15:00
Add defensive copy of task array before passing to createTaskArray()
to prevent concurrent modification during iteration in prepareLauncher().

The race condition occurred when:
1. Timer thread flushes array and calls submitAndReset()
2. createTaskArray() iterates over tasks outside the lock
3. prepareLauncher() modifies the collection during iteration

This fix ensures createTaskArray() works on its own copy of the list.
@netlify
Copy link

netlify bot commented Dec 10, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 1e72b9b
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/693ca0846fb6780008bc5d67
😎 Deploy Preview https://deploy-preview-6647--nextflow-docs-staging.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.

Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
@bentsherman
Copy link
Member

@johnoooh I went ahead and cleaned up the PR to get it ready for merging. I also pushed a temporary fix that might fix the error you are getting, let me know if it works

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.

Enhance TaskArrayCollector to support configurable timeout-based array submission

2 participants