[Merged by Bors] - continue processing a layer even when only one hash has blocks#2464
[Merged by Bors] - continue processing a layer even when only one hash has blocks#2464countvonzero wants to merge 3 commits intodevelopfrom
Conversation
|
Please see these related changes from the testnet branch: https://github.com/spacemeshos/go-spacemesh/pull/2449/files#diff-14565cc7a7d654724cd76622a3373579a10b2ef86d8d2e52787d7f0c46089b87L1142-R1170 |
c765f37 to
af71898
Compare
lrettig
left a comment
There was a problem hiding this comment.
Could you help me understand why a single zero layer result trumps even many other non-zero layer results? I'm not totally convinced this is the correct logic
@lrettig that's not the logic. the logic is, if there is any valid non-zero layer results, it returns immediately. see line 355. |
@lrettig this is exactly i am fixing. the test i added Test_notifyLayerPromiseResult_OneHasBlockData(). this test fails before this change and passes afterwards. |
lrettig
left a comment
There was a problem hiding this comment.
thanks for the explanation!
layerfetcher/layers.go
Outdated
| //if we failed getting layer data - notify | ||
| if extErr != nil { | ||
| l.log.Error("received error for layer id %v", extErr) | ||
| l.log.Error("received error %v for layer id %v", extErr, layer) |
There was a problem hiding this comment.
| l.log.Error("received error %v for layer id %v", extErr, layer) | |
| l.log.With().Error("received error", log.Err(extErr), layer) |
c192907 to
dc386b9
Compare
|
bors merge |
## Motivation the code, as is, doesn't work when we receive layer blocks in the following order t1: for layer hash1, we receive valid block data (err == nil) t2: for layer hash2, we receive error sync.getLayerFromNeighbors() will determine there is error for this layer and stop processing. ## Changes - make sync process a layer as long as there is a layer hash that returns non-empty blocks - when there is an empty layer hash, and all other layer hashes return errors, determine this layer as empty ## Test Plan added several unit tests. in particular, `Test_notifyLayerPromiseResult_OneHasBlockData()` fails before this change. ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
|
Build failed: |
|
bors merge |
## Motivation the code, as is, doesn't work when we receive layer blocks in the following order t1: for layer hash1, we receive valid block data (err == nil) t2: for layer hash2, we receive error sync.getLayerFromNeighbors() will determine there is error for this layer and stop processing. ## Changes - make sync process a layer as long as there is a layer hash that returns non-empty blocks - when there is an empty layer hash, and all other layer hashes return errors, determine this layer as empty ## Test Plan added several unit tests. in particular, `Test_notifyLayerPromiseResult_OneHasBlockData()` fails before this change. ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
|
Build failed: |
|
bors merge |
## Motivation the code, as is, doesn't work when we receive layer blocks in the following order t1: for layer hash1, we receive valid block data (err == nil) t2: for layer hash2, we receive error sync.getLayerFromNeighbors() will determine there is error for this layer and stop processing. ## Changes - make sync process a layer as long as there is a layer hash that returns non-empty blocks - when there is an empty layer hash, and all other layer hashes return errors, determine this layer as empty ## Test Plan added several unit tests. in particular, `Test_notifyLayerPromiseResult_OneHasBlockData()` fails before this change. ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
|
Pull request successfully merged into develop. Build succeeded: |
Motivation
the code, as is, doesn't work when we receive layer blocks in the following order
t1: for layer hash1, we receive valid block data (err == nil)
t2: for layer hash2, we receive error
sync.getLayerFromNeighbors() will determine there is error for this layer and stop processing.
Changes
Test Plan
added several unit tests. in particular,
Test_notifyLayerPromiseResult_OneHasBlockData()fails before this change.DevOps Notes