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 data race in gossip/discovery test #1865

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Sep 10, 2020

This change set fixes two data races:

  1. A logger reference was overriden while the logger might be in use.
    I changed the implementation so that the logger will be injected.

  2. A shared number was incremented by logger hooks that are instantiated
    multiple times for different peers.
    I made it so that each logger hook receives its own counter, which is
    no longer a counter but a map of log entries that are searched.

Change-Id: Ic69f604f30a16e1a1fb9050ba9145dfa38e05146
Signed-off-by: yacovm [email protected]

This change set fixes two data races:

1) A logger reference was overriden while the logger might be in use.
   I changed the implementation so that the logger will be injected.

2) A shared number was incremented by logger hooks that are instantiated
   multiple times for different peers.
   I made it so that each logger hook receives its own counter, which is
   no longer a counter but a map of log entries that are searched.

Change-Id: Ic69f604f30a16e1a1fb9050ba9145dfa38e05146
Signed-off-by: yacovm <[email protected]>
@yacovm yacovm requested a review from a team as a code owner September 10, 2020 11:40
@yacovm yacovm merged commit 5201e86 into hyperledger:release-1.4 Sep 10, 2020
@yacovm yacovm deleted the dataRaceFix branch September 10, 2020 12:54
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