AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r687634379
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -272,11 +272,18 @@ public void stop() {
if (log.isTraceEnabled())
log.trace(String.format("Statistics gathering stopping %d
task...", gatheringInProgress.size()));
- gatheringInProgress.values().forEach(ctx ->
ctx.futureGather().cancel(true));
-
- gatheringInProgress.clear();
+ cancelAllTasks();
if (log.isDebugEnabled())
log.debug("Statistics gathering stopped.");
}
+
+ /**
+ * Cancel all currently running statistics gathering tasks.
+ */
+ public void cancelAllTasks() {
+ gatheringInProgress.values().forEach(ctx ->
ctx.futureGather().cancel(true));
+
+ gatheringInProgress.clear();
+ }
Review comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]