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

les: wg data race fixed #15365

Merged
merged 3 commits into from
Nov 9, 2017
Merged

les: wg data race fixed #15365

merged 3 commits into from
Nov 9, 2017

Conversation

JekaMas
Copy link
Contributor

@JekaMas JekaMas commented Oct 24, 2017

Fixes #15364

@zsfelfoldi
Copy link
Contributor

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.

@GitCop
Copy link

GitCop commented Nov 7, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 98b63fbdae37d4137f8deb00ebb30d0fb47005c2
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@JekaMas
Copy link
Contributor Author

JekaMas commented Nov 7, 2017

@zsfelfoldi Thanks for advice! I've make requested changes.

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment.

Copy link
Contributor Author

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
Copy link
Contributor

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.

@GitCop
Copy link

GitCop commented Nov 8, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 596c13b55d36197a5c7887f32096cfc202d85f61
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

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.

5 participants