catchup: do not loop forever if there is no peers#6037
Merged
algorandskiy merged 2 commits intoalgorand:masterfrom Jun 20, 2024
Merged
catchup: do not loop forever if there is no peers#6037algorandskiy merged 2 commits intoalgorand:masterfrom
algorandskiy merged 2 commits intoalgorand:masterfrom
Conversation
* Add context cancellation check to fetchRound peers retrieval loop * This prevented some e2e tests to finish when a other nodes quit but the last node fell into catchup mode
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6037 +/- ##
==========================================
- Coverage 55.87% 55.87% -0.01%
==========================================
Files 482 482
Lines 68571 68576 +5
==========================================
+ Hits 38317 38318 +1
+ Misses 27652 27649 -3
- Partials 2602 2609 +7 ☔ View full report in Codecov by Sentry. |
algorandskiy
commented
Jun 20, 2024
cce
approved these changes
Jun 20, 2024
Contributor
cce
left a comment
There was a problem hiding this comment.
LGTM ... I see you are just following the pattern below, but there is a slightly shorter 1-line check for ctx cancelled/timeout besides Done():
if err := s.ctx.Err(); err != nil {
logging.Base().Debugf("ctx is done: %v", err)
return
}
as per https://pkg.go.dev/context#Context
// If Done is not yet closed, Err returns nil.
// If Done is closed, Err returns a non-nil error explaining why:
// Canceled if the context was canceled
// or DeadlineExceeded if the context's deadline passed.
jasonpaulos
approved these changes
Jun 20, 2024
Contributor
jasonpaulos
left a comment
There was a problem hiding this comment.
I agree with @cce's comment, but that's not a blocker
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
TestCatchupOverGossipfrom tests: preserve logs on LibGoalFixture failure #6030Diagnosed with debug logging in
TestCatchupOverGossip: catchup service attempted to stop but never finished while keep logging entries below until it got killed.{ "Context": "sync", "file": "service.go", "function": "github.com/algorand/go-algorand/catchup.(*Service).fetchRound", "level": "debug", "line": 762, "msg": "fetchRound: was unable to obtain a peer to retrieve the block from", "name": "127.0.0.1:0", "time": "2024-06-20T01:23:49.586961Z" }Test Plan
Existing tests