AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704175825
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -89,7 +102,25 @@ public LocalStatisticsGatheringContext
aggregateStatisticsAsync(
LocalStatisticsGatheringContext inProgressCtx =
gatheringInProgress.putIfAbsent(key, ctx);
if (inProgressCtx == null) {
- CompletableFuture<ObjectStatisticsImpl> f =
CompletableFuture.supplyAsync(aggregate, gatherPool);
+ CompletableFuture<ObjectStatisticsImpl> f =
CompletableFuture.supplyAsync(
+ () -> {
+ if (!gatheringLock.enterBusy() || !active) {
+ if (log.isDebugEnabled())
+ log.debug("Can't aggregate statistics by key " +
key + " due to inactive state.");
+ gatheringInProgress.remove(key, ctx);
Review comment:
'active' flag should be changed under busy lock.
If you failed to obtain lock, then someone who holds it must cancel
gathering.
Otherwise, without holding the lock you will remove key under race, don't
you?
--
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]