Log genuine block build failures instead of treating them as cancellations - #496
Open
samliok wants to merge 5 commits into
Open
Log genuine block build failures instead of treating them as cancellations#496samliok wants to merge 5 commits into
samliok wants to merge 5 commits into
Conversation
…d failures are logged
samliok
commented
Aug 6, 2026
| // TestEpochWarnsOnBlockBuildFailure asserts that a BuildBlock failure with no | ||
| // context cancellation is logged at Warn. createBlockBuildingTask used to call | ||
| // cancel() before checking context.Done(), so the warn was never emitted. | ||
| func TestEpochWarnsOnBlockBuildFailure(t *testing.T) { |
Collaborator
Author
There was a problem hiding this comment.
i dont think we need a test for this
yacovm
reviewed
Aug 6, 2026
| e.lock.Lock() | ||
| defer e.lock.Unlock() | ||
|
|
||
| // Record cancellation before cancel() closes the context, |
Collaborator
There was a problem hiding this comment.
we don't need to write this comment.
yacovm
reviewed
Aug 6, 2026
| } | ||
| } | ||
|
|
||
| // failingBlockBuilder fails every BuildBlock call without the context being cancelled. |
Collaborator
There was a problem hiding this comment.
I think it's a waste of test. Let's just remove this.
samliok
commented
Aug 6, 2026
samliok
marked this pull request as ready for review
August 6, 2026 20:52
yacovm
reviewed
Aug 6, 2026
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.
In createBlockBuildingTask (simplex/epoch.go), the task called cancel() before the select that distinguishes a cancelled build from a failed one. cancel() closes the context's done channel synchronously, so the <-context.Done() case was always ready and the default branch logging "Failed building block" at Warn was unreachable.