repro: sync error recovery classification is inconsistent across wrappers and causes - #2725
Draft
dorianvp wants to merge 1 commit into
Draft
repro: sync error recovery classification is inconsistent across wrappers and causes#2725dorianvp wants to merge 1 commit into
dorianvp wants to merge 1 commit into
Conversation
…f and with the failure cause Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
This PR reproduces the claim
error-classification-mismatches. It adds nine unit tests to the existing#[cfg(test)]module inpepper-sync/src/error.rs(new submoduleclassification_mismatches). Each test encodes the proposed classification, and every one fails on the current code. This is a reproduction and not a fix. No non-test code is changed.The sync-bench A/B rule was not run because the commit adds tests only.
Claims and code cites
ServerError::FetcherDroppedis classifiedrecommend_same_server() == true(pepper-sync/src/error.rs:129) andMaybeRecoverableServer(pepper-sync/src/error.rs:199). Every site that raises it ismap_err(|_| ServerError::FetcherDropped)on a local channel send or a dropped oneshot (pepper-sync/src/client.rs:107,111, and the same pattern at every other request helper). The server is not involved, so retrying the same server cannot help. Defect of fact.ServerError::RequestFailed(_)isfalse(error.rs:133) andServerUnavailable(error.rs:201) for everytonic::Status.DeadlineExceededandUnavailableare transient and retry worthy on the same server, whileUnauthenticated,InvalidArgument, andUnimplementedare not availability problems. Thetonic::Codeis carried in the variant and is never inspected. The granularity is a design judgement, and the tests encode one proposed mapping.SyncError::ScanError(_)maps toAbort(error.rs:174) even forScanError::IncorrectTreeSize(error.rs:272) andScanError::IncorrectTxid(error.rs:286), both of which describe data the server returned. Design judgement, though the existingScanError::ServerErrorarm aterror.rs:173already treats server caused scan failures as server problems.SyncError::MempoolError(_)istrue(error.rs:101) andMaybeRecoverableServer(error.rs:171), while the unwrappedServerError::RequestFailed(_)it may contain isfalseandServerUnavailable(error.rs:133,201).client.rs:406constructs exactlyMempoolError::ServerError(ServerError::RequestFailed(e)). The same failure gets the opposite verdict depending on the wrapper. Defect of fact.client.rs:215andclient.rs:352gate stream retries one.message().contains("Unexpected EOF decoding stream."), and the retry loop exists only forget_subtree_rootsandget_transparent_address_transactions. Noted for context.Tests
All nine are in
pepper-sync/src/error.rs, moduletests::classification_mismatches. Each assertion has its own#[test]so the run shows which parts fail.fetcher_dropped_is_a_local_failure_and_abortsFetcherDropped.recovery_recommendation() == Abortfetcher_dropped_does_not_recommend_the_same_server!FetcherDropped.recommend_same_server()request_failed_deadline_exceeded_retries_the_same_serverRequestFailed(deadline_exceeded)isMaybeRecoverableServerrequest_failed_unavailable_retries_the_same_serverRequestFailed(unavailable)isMaybeRecoverableServerrequest_failed_unauthenticated_is_not_server_unavailableRequestFailed(unauthenticated)is notServerUnavailablescan_error_incorrect_tree_size_tries_another_serverSyncError::ScanError(IncorrectTreeSize)isServerUnavailablescan_error_incorrect_txid_tries_another_serverSyncError::ScanError(IncorrectTxid)isServerUnavailablemempool_wrapped_request_failed_matches_direct_request_failedRequestFailedgive the samerecovery_recommendation()mempool_wrapped_request_failed_matches_direct_recommend_same_serverRequestFailedgive the samerecommend_same_server()Observed output
Command:
cargo test -p pepper-sync --lib error::tests::classification_mismatchesNote on existing tests
The existing tests
recovery_recommendation::retry_same_server::fetcher_droppedandrecovery_recommendation::try_different_server::request_failedassert the current behaviour, so a fix that adopts the proposed classification would need to update them as well.🤖 Generated with Claude Code