tillrohrmann commented on a change in pull request #6786: [FLINK-10282][rest] 
Separate REST and Dispatcher RPC thread pools
URL: https://github.com/apache/flink/pull/6786#discussion_r223612401
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
 ##########
 @@ -341,7 +343,9 @@ public void start() throws Exception {
                                        
RestHandlerConfiguration.fromConfiguration(configuration),
                                        resourceManagerGatewayRetriever,
                                        blobServer.getTransientBlobService(),
-                                       commonRpcService.getExecutor(),
+                                       
WebMonitorEndpoint.createExecutorService(
+                                               
configuration.getInteger(RestOptions.SERVER_NUM_THREADS),
+                                               "DispatcherRestEndpoint"),
 
 Review comment:
   Almost. I think we should have a field `terminationFuture`:
   ```
   private static class CloseIgnoringExecutorService extends 
AbstractExecutorService {
   
        private final Executor executor;
   
        private final CompletableFuture<Void> terminationFuture = new 
CompletableFuture<>();
   
        public CloseIgnoringExecutorService(Executor executor) {
                this.executor = executor;
        }
   
        @Override
        public void shutdown() {
                terminationFuture.complete(null);
        }
   
        @Override
        public List<Runnable> shutdownNow() {
                shutdown();
                return Collections.emptyList();
        }
   
        @Override
        public boolean isShutdown() {
                return terminationFuture.isDone();
        }
   
        @Override
        public boolean isTerminated() {
                return terminationFuture.isDone();
        }
   
        @Override
        public boolean awaitTermination(long timeout, TimeUnit unit) {
                try {
                        terminationFuture.get(timeout, unit);
                        return true;
                } catch (TimeoutException e) {
                        return false;
                }
        }
   
        @Override
        public void execute(Runnable command) {
                if (terminationFuture.isDone()) {
                        throw new RejectedExecutionException();
                } else {
                        executor.execute(command);
                }
        }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to