Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Fix a data race on startTime #1155

Closed
wants to merge 1 commit into from
Closed

Fix a data race on startTime #1155

wants to merge 1 commit into from

Conversation

janos
Copy link
Member

@janos janos commented Jan 23, 2019

This PR addresses data race described in #1154.

Global variable startTime was used concurrently. But given the nature of its usage it just have to be specific to a Swarm instance, and it does not require a lock:

  • Swarm.Start is not called in parallel
  • Swarm.updateGauges is always called after the startTime is set

There is another issue with unterminated updateGauges goroutine created by periodicallyUpdateGauges, but this is a subject to another issue (#1156).

@janos
Copy link
Member Author

janos commented Jan 23, 2019

Submitted upstream ethereum/go-ethereum#18511.

@janos janos closed this Jan 23, 2019
@frncmx frncmx deleted the race-start-time branch January 24, 2019 11:17
@frncmx frncmx mentioned this pull request Jan 24, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants