Skip to content

fix: raise on server-SHA1 mismatch, cancel sibling parts on failure, and avoid a buffer copy - #718

Merged
ffumero2003 merged 2 commits into
masterfrom
fix-python-low-audit-transfer
Nov 21, 2026
Merged

ffumero2003 merged 2 commits into
masterfrom
fix-python-low-audit-transfer

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

Three transfer paths need stronger checksum validation, cancellation, and buffer handling.

Changes

  • Raise ChecksumMismatch for an incorrect server SHA-1, including when Python optimization disables assertions.
  • Cancel pending multipart siblings when a part fails. Preserve the unfinished upload so it can be resumed; running parts cannot be forcibly stopped.
  • Read unbound upload buffers through a seekable memoryview-backed stream instead of making a full copy.
  • Add regression coverage and a bugfix changelog fragment.

Verification

  • Observed RED for C19 under python -O, C8 with a queued sibling, and C57 with an 8 MiB allocation measurement; focused tests are green.
  • Python 3.13 unit suites passed for API versions v0–v3. Existing skips and expected failures remain.
  • Ruff lint, formatting of b2sdk and test, license headers, and towncrier validation passed.
  • Master CI is already red: static checks have strict XPASS failures for C30 and C59. These unrelated checks remain unchanged. The whole-tree formatting check also flags the unchanged noxfile.py.
  • Live B2 integration tests were not run; no SDK panel was run as requested.

Refs #711

@ffumero2003 ffumero2003 self-assigned this Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff6ea1bd-3f1d-48ff-9b39-3b33fa2ae6d2
Commits

Reviewing files that changed from the base of the PR and between be0814d and 9ddebce.

Files selected for processing: 9

  • b2sdk/_internal/transfer/emerge/executor.py
  • b2sdk/_internal/transfer/emerge/unbound_write_intent.py
  • b2sdk/_internal/transfer/outbound/upload_manager.py
  • changelog.d/+transfer-audit.fixed.md
  • test/unit/bucket/test_regression_bucket.py
  • test/unit/internal/test_emerge_cancel_siblings.py
  • test/unit/internal/test_unbound_write_intent.py
  • test/unit/internal/test_upload_checksum_optimized.py
  • test/unit/stream/test_regression_streams.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@ffumero2003
ffumero2003 merged commit fdb8ceb into master Nov 21, 2026
29 checks passed
@ffumero2003
ffumero2003 deleted the fix-python-low-audit-transfer branch November 21, 2026 23:33
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