Skip to content

Commit

Permalink
maintner: fix data race in github sync
Browse files Browse the repository at this point in the history
The lastUpdated field can only be used by the sync goroutine, but we
did labels and milestones concurrently in their own goroutines.

Remove the update because it was redundant with the caller's update
anyway.

Noticed in:
golang/go#19866 (comment)

Change-Id: I4b0270a00eaf2994ed096631e24a7bd75d0210ab
Reviewed-on: https://go-review.googlesource.com/42615
Reviewed-by: Kevin Burke <kev@inburke.com>
  • Loading branch information
bradfitz committed May 4, 2017
1 parent dad4c53 commit ff2f305
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions maintner/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,6 @@ func (p *githubRepoPoller) syncMilestones(ctx context.Context) error {
return nil
}
p.c.addMutation(&maintpb.Mutation{Github: mut})
p.lastUpdate = time.Now()
return nil
}

Expand Down Expand Up @@ -1368,7 +1367,6 @@ func (p *githubRepoPoller) syncLabels(ctx context.Context) error {
if changes == 0 {
return nil
}
p.c.addMutation(&maintpb.Mutation{Github: mut})
p.lastUpdate = time.Now()
return nil
}
Expand Down

0 comments on commit ff2f305

Please sign in to comment.