fix: prevent storeDir race condition with parallel chromosome tasks on cloud executors#482
Open
ikhrustalev wants to merge 1 commit into
Open
Conversation
…n cloud executors When running multiple chromosomes in parallel on cloud executors (e.g. Google Batch with GCS FUSE), processes using storeDir write versions.yml to the same path concurrently, causing stale file handles or missing output files. Partition storeDir by sample ID and chromosome using closures for lazy evaluation, so each task gets its own isolated directory while preserving cross-run caching. Fixes PGScatalog#481
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.
Summary
Fixes #481
When running multiple chromosomes in parallel on cloud executors (e.g. Google Cloud Batch with GCS FUSE), processes using
storeDirwriteversions.ymlto the same path concurrently. The data files don't collide (they include chromosome in the filename), butversions.ymlis always the same name, causing stale file handles or missing output files.This PR partitions
storeDirby sample ID and chromosome using closures for lazy evaluation, so each task gets its own isolated directory while preserving cross-run caching.Before:
After:
storeDir { (params.genotypes_cache ? file(params.genotypes_cache) : workDir).resolve("genomes/${meta.id}/recoded/${meta.chrom}") }Changes
storeDirmeta.idandmeta.chrom(where available) to storeDir pathsTesting
nextflow run . -profile test,docker)--run_ancestry)