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

Anomaly detector detection re running in inspect mode #757 #759

Merged

Conversation

amper43
Copy link
Contributor

@amper43 amper43 commented Aug 20, 2019

fixes #757

Problem

getHSR method runs learning if cache of analytic unit is null or outdated. Panel requests HSR every second and creates a race condition between learning process and HSR requests.
Note: cache can't be outdated because learning started on each unit's update if it required in class definition.

Changes

  • don't return response with HSR if analytic unit in LEARNING state
  • remove unused method isCacheOutdated

@amper43 amper43 added this to the 0.3.7 milestone Aug 20, 2019
@amper43 amper43 requested a review from rozetko August 20, 2019 17:53
@amper43 amper43 self-assigned this Aug 20, 2019
@@ -644,7 +644,7 @@ export async function getHSR(
hsr: TableTimeSeries,
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make a class for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

according TODOs we should make it in data-kit
related issue CorpGlory/grafana-datasource-kit#89

Copy link
Contributor

@jonyrock jonyrock left a comment

Choose a reason for hiding this comment

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

Please add a test which reproduces the bug.

amper43 and others added 3 commits August 21, 2019 12:07
' of github.com:hastic/hastic-server into anomaly-detector-detection-re-running-in-inspect-mode-#757
Copy link
Contributor

@jonyrock jonyrock left a comment

Choose a reason for hiding this comment

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

Test should fail without new changes

amper43 and others added 6 commits August 21, 2019 19:22
' of github.com:hastic/hastic-server into anomaly-detector-detection-re-running-in-inspect-mode-#757
amper43 and others added 6 commits August 21, 2019 19:39
' of github.com:hastic/hastic-server into anomaly-detector-detection-re-running-in-inspect-mode-#757
' of github.com:hastic/hastic-server into anomaly-detector-detection-re-running-in-inspect-mode-#757
@jonyrock jonyrock merged commit d469c1e into master Aug 21, 2019
@rozetko rozetko deleted the anomaly-detector-detection-re-running-in-inspect-mode-#757 branch October 7, 2019 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anomaly detector: detection re-running in inspect mode
3 participants