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 a team as a code owner June 2, 2021 16:11
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/java-bigtable API. label Jun 2, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 2, 2021
@mutianf mutianf requested a review from igorbernstein2 June 2, 2021 16:25

// 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

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

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

Choose a reason for hiding this comment

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

lgtm!

@mutianf mutianf merged commit 66a9c9e into googleapis:master Jun 3, 2021
@mutianf mutianf deleted the flaky_test branch June 3, 2021 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants