Skip to content

compress: treat an empty BORG_ZSTD_MT_WORKERS as unset - #10323

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:zstd-mt-workers-empty
Sep 3, 2026
Merged

compress: treat an empty BORG_ZSTD_MT_WORKERS as unset#10323
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:zstd-mt-workers-empty

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

An empty value made borg fail:

$ BORG_ZSTD_MT_WORKERS= borg benchmark cpu --compressing --data ~/silesia
Compression ==========================================================
zstd,-4 (2MiB)             failed: Error: Error: BORG_ZSTD_MT_WORKERS must be an integer, but is: ''

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_WORKERS docs (borg help env_vars and
docs/usage/general/environment.rst.inc).

🤖 Generated with Claude Code

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

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.70%. Comparing base (94bd5bd) to head (3e7da72).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
ThomasWaldmann merged commit fe541df into borgbackup:master Sep 3, 2026
26 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the zstd-mt-workers-empty branch September 3, 2026 17:22
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.

1 participant