-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
les: wg data race fixed #15365
les: wg data race fixed #15365
Conversation
bfdbcff
to
853d5d3
Compare
Thanks for catching it! There is a better way to fix this though. wg.Add should not happen inside the goroutine but before starting it. Then it is guaranteed that it runs in the init phase, before starting the entire LightEthereum backend and the additional semaphore is not needed at all. |
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
98b63fb
to
b85aca6
Compare
@zsfelfoldi Thanks for advice! I've make requested changes. |
b85aca6
to
a231fdb
Compare
les/handler.go
Outdated
@@ -242,7 +243,7 @@ func (pm *ProtocolManager) Stop() { | |||
// will exit when they try to register. | |||
pm.peers.Close() | |||
|
|||
// Wait for any process action | |||
// Wait for any process action. Wait should be executed after all pm.wg.Add() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This and upper changes has been done.
les/handler.go
Outdated
@@ -115,6 +115,7 @@ type ProtocolManager struct { | |||
|
|||
// channels for fetcher, syncer, txsyncLoop | |||
newPeerCh chan *peer | |||
isClosed *int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is left over from your previous change, please remove.
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
596c13b
to
b04eb83
Compare
Fixes #15364