This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
googlebot
added
the
cla: yes
Auto: added by CLA bot when all committers have signed a CLA.
label
Sep 7, 2020
It looks like either gorm or the opencensus library we're using has a data race:
|
sethvargo
force-pushed
the
sethvargo/race
branch
from
September 7, 2020 21:10
c51d8ed
to
78519e6
Compare
sethvargo
force-pushed
the
sethvargo/race
branch
from
September 7, 2020 21:10
78519e6
to
6dacd99
Compare
Hmm - pretty sure GH-396 broke some stuff. Gonna revert for now. |
mikehelmick
approved these changes
Sep 7, 2020
While working on some other stuff locally and running the tests, I occasionally saw many data races. I think we've also seen these a few times on prow, so I figured I'd dig in. There were two separate data races: 1. The DefaultOptions in migrations is a global mutable. Despite always setting the value to false (and the default being false), the race detector sees this as a data-write and barfs. I removed it, since it's the default value. 2. In the event we failed to connect to the database, we were still registering the opencensus views. Furthermore, we could succeed connecting to the database, but fail to initialize gorm, which would trigger a re-connect. This separates the "connect to the database" and "connect to the database via gorm" steps into separate retries. It also moves the opencenusus and driver initialization into a package-level init.
Under heavy load, this causes a race where the struct is created (and thus the time is set), but the test might not run for a few more seconds. By switching this to a function, we ensure it's only called immediately before executing instead of during scheduling.
sethvargo
force-pushed
the
sethvargo/race
branch
from
September 7, 2020 21:54
dd51b2c
to
f0d6f70
Compare
That passed. I'm gonna retest just to make sure... /retest |
mikehelmick
approved these changes
Sep 7, 2020
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikehelmick, sethvargo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Woofta. Thanks for catching @sethvargo. /cc @taddari |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on some other stuff locally and running the tests, I occasionally saw many data races. I think we've also seen these a few times on prow, so I figured I'd dig in. There were two separate data races:
The DefaultOptions in migrations is a global mutable. Despite always setting the value to false (and the default being false), the race detector sees this as a data-write and barfs. I removed it, since it's the default value.
In the event we failed to connect to the database, we were still registering the opencensus views. Furthermore, we could succeed connecting to the database, but fail to initialize gorm, which would trigger a re-connect. This separates the "connect to the database" and "connect to the database via gorm" steps into separate retries. It also moves the opencenusus and driver initialization into a package-level init.We've temporarily reverted the OC integration.
The verification codes tests create verification codes in the struct with a set expiration. Those times are set on load, not "on test run". When the system is under heavy load, there could be 5-10s between when the struct is created and when the test is run. To fix this, we changed the test cases to return a function that returns a verification code, ensuring the time-based tests run right before use, not on load.
Release Note