fix(rpc): Race condition when waiting for response on broadcast_tx_sync/commit (backport #3193)#3194
Merged
fix(rpc): Race condition when waiting for response on broadcast_tx_sync/commit (backport #3193)#3194
broadcast_tx_sync/commit (backport #3193)#3194Conversation
…ync/commit` (#3193) This PR fixes a race condition generated when calling `broadcast_tx_sync` and `broadcast_tx_commit`. When closing the context, we want to also close the goroutine waiting for the response with `reqRes.Wait()`. We don't need to do `reqRes.Done()` because there is a chance it may become negative; instead, we just let the ABCI client to do it. This bug was recently introduced by #3131. --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit cd465c5) # Conflicts: # rpc/core/mempool.go
This comment was marked as resolved.
This comment was marked as resolved.
hvanz
approved these changes
Jun 5, 2024
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.
This PR fixes a race condition generated when calling
broadcast_tx_syncandbroadcast_tx_commit. When closing the context, we want to also close the goroutine waiting for the response withreqRes.Wait(). We don't need to doreqRes.Done()because there is a chance it may become negative; instead, we just let the ABCI client to do it.This bug was recently introduced by #3131.
PR checklist
.changelog(we use unclog to manage our changelog)docs/orspec/) and code commentsThis is an automatic backport of pull request #3193 done by [Mergify](https://mergify.com).