compress: treat an empty BORG_ZSTD_MT_WORKERS as unset - #10323
Merged
ThomasWaldmann merged 1 commit intoSep 3, 2026
Conversation
An empty value made borg fail:
$ BORG_ZSTD_MT_WORKERS= borg benchmark cpu --compressing
Error: BORG_ZSTD_MT_WORKERS must be an integer, but is: ''
That is unhelpful - an env var that is set to an empty string is usually
meant to be "not configured", e.g. when a wrapper script or a systemd unit
passes a variable through unconditionally. Use the defaults in that case
(whitespace-only values are treated the same way).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10323 +/- ##
==========================================
+ Coverage 87.65% 87.70% +0.04%
==========================================
Files 103 103
Lines 18716 18716
Branches 2881 2881
==========================================
+ Hits 16405 16414 +9
+ Misses 1609 1600 -9
Partials 702 702 ☔ View full report in Codecov by Harness. |
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.
An empty value made borg fail:
An env var set to an empty string usually means "not configured" - e.g. when a wrapper
script or a systemd unit passes a variable through unconditionally. So use the default
values in that case instead of erroring out (whitespace-only values are treated the same
way). Non-empty invalid values (
yes,4x,1.5,-1) still raise as before.Also updated the test and the
BORG_ZSTD_MT_WORKERSdocs (borg help env_varsanddocs/usage/general/environment.rst.inc).🤖 Generated with Claude Code