Skip to content

repository: drop "wait" arg, make put/delete synchronous#9782

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:remove-repository-wait-async
Jun 16, 2026
Merged

repository: drop "wait" arg, make put/delete synchronous#9782
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:remove-repository-wait-async

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

What

The new borgstore-based Repository still carried put(..., wait=) / delete(..., wait=) and an async_response() method, inherited from the legacy RemoteRepository's pipelined RPC protocol.

In the new architecture these are dead:

  • borgstore's Store/backend API is strictly synchronous, so put/delete ignored wait and always ran synchronously;
  • async_response() was an empty stub that always returned None.

This PR removes wait and async_response() so the synchronous behavior is explicit, and cleans up every caller that still threaded wait=False / drained async_response():

  • Repository.put / Repository.delete — drop wait; remove async_response().
  • Cache.add_chunk — drop wait, call repository.put(id, cdata).
  • archive.py — drop wait=False from the three add_chunk calls, remove the per-call async_response(wait=False) and the while ... async_response(wait=True) drain loop in save().
  • archiver/transfer_cmd.py — drop wait=False from the add_chunk calls and the async_response(wait=False) line.
  • testsuite/archive_test.py — update the MockCache mock accordingly.

src/borg/legacy/ is intentionally untouched — the legacy repository/remote keep their real wait/async implementation.

Testing

  • pytest src/borg/testsuite/archive_test.py src/borg/testsuite/repository_test.py → all pass.
  • Manual smoke: repo-createcreatetransfercheck across two local repos, exercising the write_chunk and transfer paths that previously used wait=False. All OK.

🤖 Generated with Claude Code

The new borgstore-based Repository inherited put(..., wait=) / delete(..., wait=)
and async_response() from the legacy RemoteRepository's pipelined RPC protocol.
In the new architecture these are dead: borgstore's API is strictly synchronous,
so put/delete ignored wait and ran synchronously, and async_response() was an
empty stub always returning None.

Remove wait and async_response() so the synchronous behavior is explicit, and
clean up every caller that still threaded wait=False / drained async_response()
(cache.add_chunk, archive.py, transfer_cmd.py, and the archive_test mock).

The legacy repository/remote keep their real wait/async implementation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ThomasWaldmann ThomasWaldmann marked this pull request as ready for review June 16, 2026 09:42
@ThomasWaldmann ThomasWaldmann changed the title repository: drop the dead "wait" arg, make put/delete always synchronous repository: drop "wait" arg, make put/delete synchronous Jun 16, 2026
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.89%. Comparing base (2eef6c8) to head (06b1004).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9782   +/-   ##
=======================================
  Coverage   84.88%   84.89%           
=======================================
  Files          92       92           
  Lines       15172    15161   -11     
  Branches     2275     2273    -2     
=======================================
- Hits        12879    12871    -8     
+ Misses       1589     1588    -1     
+ Partials      704      702    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann ThomasWaldmann merged commit 8f6d55c into borgbackup:master Jun 16, 2026
19 of 20 checks passed
@ThomasWaldmann ThomasWaldmann deleted the remove-repository-wait-async branch June 16, 2026 12:08
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