-
Notifications
You must be signed in to change notification settings - Fork 1.9k
IGNITE-15281 add cluster state check into statistics manager. #9314
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
Conversation
| public void cancelAllTasks() { | ||
| gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true)); | ||
|
|
||
| gatheringInProgress.clear(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be is called from StatisticsManager.disableOperations() as a reaction on configuration changes.
And StatisticsManager.processObsolescence() that is called from scheduler can put into gatheringInProgress in parallel.
Seems, both StatisticsManager methods are marked synchronized, but actually don't check the state under lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't totally fix the possibility of failure cause we can change state during processObsolescence execution. But I move state check directly into it to improve readability and lower this chance a bit.
...a/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsConfigurationManager.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
Show resolved
Hide resolved
...c/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
Show resolved
Hide resolved
...exing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
Show resolved
Hide resolved
| if (!active) { | ||
| newCtx.cancel(); | ||
| gatheringInProgress.remove(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you read 'active' flag and remove key under busylock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not here, it's just a fast way to skip scheduling if active=false.
Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com>
|
Replaced with #9423 |
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.