remote: fix StoreObjectNotFound exception lost over RPC, fixes #9380#9381
Open
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Open
remote: fix StoreObjectNotFound exception lost over RPC, fixes #9380#9381mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9381 +/- ##
==========================================
+ Coverage 76.44% 76.47% +0.03%
==========================================
Files 85 85
Lines 14799 14801 +2
Branches 2212 2213 +1
==========================================
+ Hits 11313 11319 +6
+ Misses 2808 2804 -4
Partials 678 678 ☔ View full report in Codecov by Sentry. |
Member
ThomasWaldmann
left a comment
There was a problem hiding this comment.
great, some TODOs less!
d406fe2 to
1935d75
Compare
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.
Summary
RemoteRepositoryRPC layer serializes exceptions usinge.__class__.__name__, but bothborgstore.store.ObjectNotFoundandRepository.ObjectNotFoundshare__name__ == "ObjectNotFound"handle_erroralways reconstructsRepository.ObjectNotFound, even when the server actually raisedStoreObjectNotFoundfrom astore_load()/store_delete()callcache.py:# TODO: ^ seem like RemoteRepository raises Repository.ONF instead of StoreONFStoreObjectNotFoundduring server-side serialization and reconstruct it correctly on the client sideFixes #9380
Changes
src/borg/remote.pyStoreObjectNotFound; serialize it as"StoreObjectNotFound"(not ambiguous"ObjectNotFound") on the server side; add client-sidehandle_errorbranch to reconstruct it; addinject_exceptiontest hooksrc/borg/cache.pyexceptclauses from(Repository.ObjectNotFound, StoreObjectNotFound)toStoreObjectNotFound; remove TODO commentssrc/borg/testsuite/repository_test.pyStoreObjectNotFoundround-trip test intest_remote_rpc_exception_transportBackward compatibility note
This changes the RPC wire format for
StoreObjectNotFound:"ObjectNotFound", new client raisesRepository.ObjectNotFound-cache.pycallers would miss it. In practice,store_*methods are borg2-only and borg2 is in beta, so mixed-version deployments are not a supported scenario.RPCErrorfallback.Checklist
master