Skip to content

Fix possible data race in manager/state/store/memory_test.go#2537

Merged
cyli merged 1 commit intomoby:masterfrom
delftswa2018:2536-data-race
Mar 5, 2018
Merged

Fix possible data race in manager/state/store/memory_test.go#2537
cyli merged 1 commit intomoby:masterfrom
delftswa2018:2536-data-race

Conversation

@VincentRbbmnd
Copy link
Copy Markdown

This PR is a fix for #2536, essentially using the first proposed way of fixing the original issue.

This fixes a possible data race in manager/state/store/memory_test.go

An alternative to this fix would be to define a new variable in the following way:

    for c := 0; c != 5; c++ {
        ...
        x := c
        go func() {
            ...
            Name: nodeIDs[i%benchmarkNumNodes] + "_" + strconv.Itoa(x) + "_" + strconv.Itoa(i),
            ...
        }
    }

Signed-off-by: Vincent Robbemond <vincentrobbemond@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2018

Codecov Report

Merging #2537 into master will decrease coverage by 0.09%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           master   #2537     +/-   ##
========================================
- Coverage   61.49%   61.4%   -0.1%     
========================================
  Files         133     133             
  Lines       21736   21736             
========================================
- Hits        13367   13347     -20     
- Misses       6932    6940      +8     
- Partials     1437    1449     +12

Copy link
Copy Markdown
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix @VincentRbbmnd

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.

3 participants