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

fix: Fix the race condition in decay average - #850

Merged
mutianf merged 11 commits into
googleapis:masterfrom
mutianf:flaky_test
Jun 3, 2021
Merged

fix: Fix the race condition in decay average#850
mutianf merged 11 commits into
googleapis:masterfrom
mutianf:flaky_test

Conversation

@mutianf

@mutianf mutianf commented Jun 2, 2021

Copy link
Copy Markdown
Contributor

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 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
Copy Markdown
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
Copy Markdown
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?

@igorbernstein2 igorbernstein2 left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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