sashapolo commented on code in PR #3068:
URL: https://github.com/apache/ignite-3/pull/3068#discussion_r1461739575
##########
modules/network/src/main/java/org/apache/ignite/network/DefaultMessagingService.java:
##########
@@ -531,4 +547,36 @@ public void stopDroppingMessages() {
public ConnectionManager connectionManager() {
return connectionManager;
}
+
+ private static class CriticalLazyStripedExecutor extends
LazyStripedExecutor {
+ private final CriticalWorkerRegistry workerRegistry;
+
+ private final List<CriticalWorker> registeredWorkers = new
CopyOnWriteArrayList<>();
+
+ CriticalLazyStripedExecutor(String nodeName, String poolName,
CriticalWorkerRegistry workerRegistry) {
+ super(nodeName, poolName);
+
+ this.workerRegistry = workerRegistry;
+ }
+
+ @Override
+ protected ExecutorService newSingleThreadExecutor(NamedThreadFactory
threadFactory) {
+ CriticalSingleThreadExecutor executor = new
CriticalSingleThreadExecutor(threadFactory);
+
+ workerRegistry.register(executor);
+
+ registeredWorkers.add(executor);
+
+ return executor;
+ }
+
+ @Override
+ protected void onStoppingInitiated() {
+ super.onStoppingInitiated();
+
+ for (CriticalWorker worker : registeredWorkers) {
+ workerRegistry.unregister(worker);
Review Comment:
My point is: it is inconvenient that all components need to maintain the
list of their workers themselves. Maybe we can alter the inner structure of the
Registry so that it would have something like a `Map<Class, List>` so that we
can de-register a bunch of workers using a component's class?
--
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]