Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix select #567

Merged
merged 2 commits into from
Dec 4, 2023
Merged

fix select #567

merged 2 commits into from
Dec 4, 2023

Conversation

pfi79
Copy link
Contributor

@pfi79 pfi79 commented Nov 26, 2023

I'm repeatedly running existing tests. Trying to make them more reliable.

On another iteration, I found that one test tries to complete but hangs because of this line:

v.inFlightDecideChan <- struct{}{}

inFlightDecideChan is a synchronous channel, and it waits "forever" for the subscriber on the other side of the channel.

How to fix this?
Only by rewriting this part of the code to something similar to:

select {
case v.inFlightDecideChan <- struct{}{}:
	return
case <-v.stopChan:
	return
}

Signed-off-by: Fedor Partanskiy <[email protected]>
@pfi79 pfi79 requested a review from C0rWin November 26, 2023 20:25
@C0rWin C0rWin merged commit 452a323 into v2 Dec 4, 2023
3 checks passed
@C0rWin C0rWin deleted the fix-select branch December 4, 2023 13:31
yacovm pushed a commit to fabric-research/consensus that referenced this pull request Feb 19, 2024
Signed-off-by: Fedor Partanskiy <[email protected]>
Co-authored-by: pfi79 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants