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: Fix the race condition in decay average #850

Merged
merged 11 commits into from Jun 3, 2021

Conversation

mutianf
Copy link
Contributor

@mutianf mutianf commented Jun 2, 2021

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

@mutianf mutianf requested a review from as a code owner Jun 2, 2021
@product-auto-label product-auto-label bot added the api: bigtable label Jun 2, 2021
@google-cla google-cla bot added the cla: yes label Jun 2, 2021
@mutianf mutianf requested a review from igorbernstein2 Jun 2, 2021

// Set last update time so when we're getting the mean we can calculate the decay based on the
// last time the mean was updated.
if (now > lastUpdateTimeInSecond.get()) {
lastUpdateTimeInSecond.set(now);
Copy link
Contributor

@igorbernstein2 igorbernstein2 Jun 2, 2021

Choose a reason for hiding this comment

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

why is this still necessary? isnt this done in updateStartTime now?

Copy link
Contributor Author

@mutianf mutianf Jun 2, 2021

Choose a reason for hiding this comment

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

Hmm, so if getMean is called after like 5 minutes of update (before we need to update start time) the average will be decayed?

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

lgtm!

@mutianf mutianf merged commit 66a9c9e into googleapis:master Jun 3, 2021
16 checks passed
@mutianf mutianf deleted the flaky_test branch Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants