AMashenkov commented on a change in pull request #9544:
URL: https://github.com/apache/ignite/pull/9544#discussion_r748024645
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/BusyExecutor.java
##########
@@ -38,28 +40,43 @@
private volatile boolean active;
/** Lock protection of started gathering during deactivation. */
- private final GridBusyLock busyLock = new GridBusyLock();
+ private volatile GridBusyLock busyLock = new GridBusyLock();
/** Executor pool. */
private final IgniteThreadPoolExecutor pool;
+ /** Cancellable tasks. */
+ private final GridConcurrentHashSet<CancellableTask> cancellableTasks =
new GridConcurrentHashSet<>();
+
+ /** External stopping supplier. */
+ Supplier<Boolean> stopping;
+
/**
* Constructor.
*
* @param name Executor name.
* @param pool Underlying thread pool executor.
+ * @param stopping External stopping state supplier.
* @param logSupplier Log supplier.
*/
- public BusyExecutor(String name, IgniteThreadPoolExecutor pool,
Function<Class<?>, IgniteLogger> logSupplier) {
+ public BusyExecutor(
+ String name,
+ IgniteThreadPoolExecutor pool,
+ Supplier<Boolean> stopping,
+ Function<Class<?>, IgniteLogger> logSupplier) {
this.name = name;
this.pool = pool;
+ this.stopping = stopping;
this.log = logSupplier.apply(StatisticsProcessor.class);
+ busyLock.block();
}
/**
* Allow operations.
*/
- public void activate() {
+ public synchronized void activate() {
+
+ busyLock = new GridBusyLock();
Review comment:
```suggestion
busyLock = new GridBusyLock();
```
--
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]