dombizita commented on code in PR #3821:
URL: https://github.com/apache/ozone/pull/3821#discussion_r1004474377


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -255,6 +265,22 @@ public void start() {
         TimeUnit.MILLISECONDS);
   }
 
+  private void stopSyncDataFromOMThread() {
+    scheduler.shutdownNow();

Review Comment:
   This approach is not working, as the `scheduler.shutdownNow()` is returning 
a "list of tasks that never commenced execution". So that will never be empty, 
as we will always have the next one scheduled. I don't know how could we add a 
sanity check here, but here is the documentation for `shutdownNow()`.
   ```
       /**
        * Attempts to stop all actively executing tasks, halts the
        * processing of waiting tasks, and returns a list of the tasks
        * that were awaiting execution.
        *
        * <p>This method does not wait for actively executing tasks to
        * terminate.  Use {@link #awaitTermination awaitTermination} to
        * do that.
        *
        * <p>There are no guarantees beyond best-effort attempts to stop
        * processing actively executing tasks.  For example, typical
        * implementations will cancel via {@link Thread#interrupt}, so any
        * task that fails to respond to interrupts may never terminate.
        *
        * @return list of tasks that never commenced execution
        * @throws SecurityException if a security manager exists and
        *         shutting down this ExecutorService may manipulate
        *         threads that the caller is not permitted to modify
        *         because it does not hold {@link
        *         java.lang.RuntimePermission}{@code ("modifyThread")},
        *         or the security manager's {@code checkAccess} method
        *         denies access.
        */
       List<Runnable> shutdownNow();
    
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to