rpcclient: safe read and write to batch#2273
Merged
guggero merged 1 commit intobtcsuite:masterfrom Dec 18, 2024
Merged
Conversation
Member
|
Approved CI. |
Pull Request Test Coverage Report for Build 12370739640Details
💛 - Coveralls |
guggero
reviewed
Nov 25, 2024
Collaborator
guggero
left a comment
There was a problem hiding this comment.
Thanks for the fix! Just two minor nits.
Contributor
Author
One more nit here b3d9947 |
guggero
approved these changes
Nov 28, 2024
Collaborator
guggero
left a comment
There was a problem hiding this comment.
Can you squash the commits into one please?
Then this is good to go.
a8cddef to
d815651
Compare
guggero
approved these changes
Dec 16, 2024
yyforyongyu
added a commit
to yyforyongyu/lnd
that referenced
this pull request
Dec 17, 2024
Collaborator
|
Could you do a rebase on master? I'm trying to test it in |
d815651 to
db5318b
Compare
Contributor
Author
done |
yyforyongyu
added a commit
to yyforyongyu/lnd
that referenced
this pull request
Dec 17, 2024
yyforyongyu
added a commit
to yyforyongyu/lnd
that referenced
this pull request
Dec 18, 2024
yyforyongyu
added a commit
to yyforyongyu/lnd
that referenced
this pull request
Dec 18, 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 tries to make batchList concurrent-safe.
The
Send()could panic at the line 1730 if c.removeRequest returnednil. It could returnnilif we try to callSend()concurrently.btcd/rpcclient/infrastructure.go
Lines 1708 to 1730 in 684d64a
After the quick look I've noticed that there are places where the batchList is update unsafely. So, the simplest fix is just to add locks, but I'm afraid if it could break something else, because I'm not very familiar with the library.