fix: remove erroneous assert in the scheduler (is_main_process)#3881
fix: remove erroneous assert in the scheduler (is_main_process)#3881johanneskoester merged 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughThe change modifies the control flow in job scheduler logic for retrieving storage inputs for remote jobs. It introduces a condition variable to distinguish between shared filesystem usage and remote execution scenarios, removes an assertion about main process execution, and reworks the conditional branching for storage input retrieval based on filesystem type. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/snakemake/scheduling/job_scheduler.py (1)
368-380: Logic change correctly removes the erroneous assertion.The conditional logic properly handles both execution modes:
- Main process with shared FS: retrieves storage inputs once on shared storage
- Remote execution without shared FS: retrieves storage inputs in the remote context
The fix appropriately removes what was likely an overly restrictive assertion about running only in the main process.
The comment at lines 372-374 could be updated to better reflect the dual-path logic:
- # Retrieve storage inputs for remote jobs, as storage local copies are handled - # via a shared filesystem. - # If local copies are not shared, they will be downloaded in the remote job. + # Retrieve storage inputs for remote jobs based on execution mode: + # - In main process with shared FS: download once on shared storage for all remote jobs + # - In remote execution without shared FS: download in this remote instance + # Otherwise, remote jobs will download their own inputs as needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/snakemake/scheduling/job_scheduler.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
⚙️ CodeRabbit configuration file
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
Files:
src/snakemake/scheduling/job_scheduler.py
🧬 Code graph analysis (1)
src/snakemake/scheduling/job_scheduler.py (1)
src/snakemake/workflow.py (3)
dryrun(419-423)is_main_process(273-274)remote_exec(458-459)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (47)
- GitHub Check: tests (9, windows-2022, py313)
- GitHub Check: tests (10, windows-2022, py313)
- GitHub Check: tests (10, ubuntu-latest, py313)
- GitHub Check: tests (7, ubuntu-latest, py313)
- GitHub Check: tests (4, ubuntu-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py311)
- GitHub Check: tests (10, ubuntu-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py312)
- GitHub Check: tests (8, ubuntu-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py313)
- GitHub Check: tests (4, ubuntu-latest, py313)
- GitHub Check: tests (6, windows-2022, py313)
- GitHub Check: tests (8, windows-2022, py313)
- GitHub Check: tests (7, ubuntu-latest, py311)
- GitHub Check: tests (6, ubuntu-latest, py313)
- GitHub Check: tests (8, ubuntu-latest, py311)
- GitHub Check: tests (8, macos-latest, py313)
- GitHub Check: tests (7, windows-2022, py313)
- GitHub Check: tests (1, ubuntu-latest, py313)
- GitHub Check: tests (8, ubuntu-latest, py313)
- GitHub Check: tests (5, windows-2022, py313)
- GitHub Check: tests (6, ubuntu-latest, py311)
- GitHub Check: tests (7, macos-latest, py313)
- GitHub Check: tests (10, ubuntu-latest, py311)
- GitHub Check: tests (7, ubuntu-latest, py312)
- GitHub Check: tests (3, windows-2022, py313)
- GitHub Check: tests (6, ubuntu-latest, py312)
- GitHub Check: tests (5, ubuntu-latest, py313)
- GitHub Check: tests (5, ubuntu-latest, py312)
- GitHub Check: tests (4, windows-2022, py313)
- GitHub Check: tests (4, ubuntu-latest, py311)
- GitHub Check: tests (1, ubuntu-latest, py311)
- GitHub Check: tests (6, macos-latest, py313)
- GitHub Check: tests (2, ubuntu-latest, py311)
- GitHub Check: tests (3, ubuntu-latest, py313)
- GitHub Check: tests (5, ubuntu-latest, py311)
- GitHub Check: tests (1, windows-2022, py313)
- GitHub Check: tests (2, ubuntu-latest, py313)
- GitHub Check: tests (3, ubuntu-latest, py312)
- GitHub Check: tests (3, ubuntu-latest, py311)
- GitHub Check: tests (2, ubuntu-latest, py312)
- GitHub Check: tests (2, windows-2022, py313)
- GitHub Check: tests (2, macos-latest, py313)
- GitHub Check: tests (1, ubuntu-latest, py312)
- GitHub Check: tests (1, macos-latest, py313)
- GitHub Check: docs
- GitHub Check: apidocs
🔇 Additional comments (1)
src/snakemake/scheduling/job_scheduler.py (1)
362-365: LGTM!The
is_shared_fsflag correctly identifies whether storage local copies are handled via a shared filesystem, enabling the conditional logic below to distinguish between shared and non-shared filesystem execution modes.
🤖 I have created a release *beep* *boop* --- ## [9.14.5](v9.14.4...v9.14.5) (2025-12-15) ### Bug Fixes * remove erroneous assert in the scheduler (is_main_process) ([#3881](#3881)) ([d5acdd1](d5acdd1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…emake#3881) <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced job scheduling for remote execution environments with improved handling of shared filesystem configurations and more flexible storage input retrieval logic across different execution scenarios. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🤖 I have created a release *beep* *boop* --- ## [9.14.5](snakemake/snakemake@v9.14.4...v9.14.5) (2025-12-15) ### Bug Fixes * remove erroneous assert in the scheduler (is_main_process) ([snakemake#3881](snakemake#3881)) ([d5acdd1](snakemake@d5acdd1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.