Skip to content

fix: reporting remote nodes number#3978

Merged
johanneskoester merged 3 commits into
mainfrom
fix/remote_nodes_number
May 29, 2026
Merged

fix: reporting remote nodes number#3978
johanneskoester merged 3 commits into
mainfrom
fix/remote_nodes_number

Conversation

@cmeesters

@cmeesters cmeesters commented Feb 19, 2026

Copy link
Copy Markdown
Member

When passing -j unlimited, workflow.py reports Provided remote nodes: 9223372036854775807 (this number happens to be my sys.maxsize. This is rather confusing. Hence, this PR which in this case just reports The number of remote nodes is set to be unlimited.. Hope that is fine. There are no additional tests or documentation setting necessary.

Summary by CodeRabbit

  • Bug Fixes
    • Improved logging clarity for remote execution by displaying "unlimited" when node allocation is unrestricted, and specific numeric values otherwise.

@cmeesters cmeesters changed the title fix: remote nodes number fix: reporting remote nodes number Feb 19, 2026

@johanneskoester johanneskoester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just say "Provided remote nodes: unlimited"? A bit easier to read since it has the same structure as in the other case.

@coderabbitai

coderabbitai Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A logging adjustment in the execute method where remote node counts are now formatted as "unlimited" when nodes equals sys.maxsize, otherwise displaying the numeric value.

Changes

Cohort / File(s) Summary
Logging Enhancement
src/snakemake/workflow.py
Modified remote nodes logging to display "unlimited" when nodes equals sys.maxsize, otherwise shows numeric value.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description explains the fix well but does not follow the repository's PR template structure, which requires explicit QC checklist completion for test coverage and documentation updates. Use the repository's PR template format and explicitly check off the QC checklist items confirming test coverage and documentation status.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing the reporting of remote nodes number to display 'unlimited' instead of a confusing system maximum integer value.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remote_nodes_number

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cmeesters

Copy link
Copy Markdown
Member Author

@johanneskoester yes. Sure. Then again ... the number of nodes is neither finite nor unlimited. It is rather a number of concurrent jobs, we set or allow with -j.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/snakemake/workflow.py (1)

1384-1391: Code is correct, but consider using the formatted display value in the event payload for consistency.

The nodes_str ternary correctly formats the output as "unlimited" when self.nodes == sys.maxsize. However, the extra=dict(..., nodes=self.nodes) still passes the raw integer value to the structured log payload, which will be 9223372036854775807 for unlimited nodes. This inconsistency may confuse downstream log consumers.

Optional: use the formatted value in the event payload
-                        logger.info(
-                            f"Provided remote nodes: {nodes_str}",
-                            extra=dict(event=LogEvent.RESOURCES_INFO, nodes=self.nodes),
-                        )
+                        logger.info(
+                            f"Provided remote nodes: {nodes_str}",
+                            extra=dict(event=LogEvent.RESOURCES_INFO, nodes=nodes_str),
+                        )

Note: This is optional because the current design (numeric value in structured event, formatted string in message) is a valid choice for consumers that need the actual integer value. Only apply this if downstream event consumers expect a human-readable format.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/snakemake/workflow.py` around lines 1384 - 1391, The log message uses
nodes_str for the human-readable message but passes the raw self.nodes integer
in the structured payload; update the logger call so the extra payload uses the
formatted display value (nodes_str) instead of self.nodes to keep message and
event payload consistent—locate the logger.info invocation that currently builds
nodes_str and change extra=dict(event=LogEvent.RESOURCES_INFO, nodes=self.nodes)
to supply nodes=nodes_str (preserving LogEvent.RESOURCES_INFO and the same
logger.info call).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/snakemake/workflow.py`:
- Around line 1384-1391: The log message uses nodes_str for the human-readable
message but passes the raw self.nodes integer in the structured payload; update
the logger call so the extra payload uses the formatted display value
(nodes_str) instead of self.nodes to keep message and event payload
consistent—locate the logger.info invocation that currently builds nodes_str and
change extra=dict(event=LogEvent.RESOURCES_INFO, nodes=self.nodes) to supply
nodes=nodes_str (preserving LogEvent.RESOURCES_INFO and the same logger.info
call).

@johanneskoester johanneskoester merged commit 8c534f0 into main May 29, 2026
60 checks passed
@johanneskoester johanneskoester deleted the fix/remote_nodes_number branch May 29, 2026 13:42
johanneskoester pushed a commit that referenced this pull request May 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[9.21.1](v9.21.0...v9.21.1)
(2026-05-29)


### Bug Fixes

* add default json function to benchmarks
([#4128](#4128))
([41fab22](41fab22))
* do not rerun when checkpoint job missing but downstream file exists
([#4124](#4124))
([a060b93](a060b93))
* ensure that error logs contain all available details
([#4183](#4183))
([74a86e9](74a86e9))
* handle missing pss attribute in benchmark on Windows
([#4160](#4160))
([da52080](da52080))
* implement Resources.setdefault
([#3968](#3968))
([2413e99](2413e99))
* reporting remote nodes number
([#3978](#3978))
([8c534f0](8c534f0))
* resolve pathvars before constructing storage queries
([#3969](#3969))
([bd15237](bd15237))
* storage temp() file cleanup with RemoteProvider
([#4189](#4189))
([898bad1](898bad1))
* tolerate FileNotFoundError in drop_iocache
([#4153](#4153))
([#4191](#4191))
([ce26b28](ce26b28))


### Documentation

* Added guide on debugging workflows
([#4029](#4029))
([3d052ae](3d052ae))
* **cli:** Remove broken ref bold markup
([#4204](#4204))
([1200ebf](1200ebf))
* remove duplicated resources attribute in rules.rst
([#4190](#4190))
([6c8ecdd](6c8ecdd))
* **rules:** Update script type hint advice
([#4193](#4193))
([6108712](6108712))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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