sodonnel opened a new pull request, #3357:
URL: https://github.com/apache/ozone/pull/3357

   ## What changes were proposed in this pull request?
   
   On my laptop, TestSCMSafeModeManager.testSafeModePipelineExitRule() always 
takes just over 200 seconds. Checking a few PR runs, it does not seem to be 
slow on PRs, just locally.
   
   Debugging the code, it seems to hang in the BackgroundPipelineCreator.stop() 
method, where it is waiting for the tread to join:
   
   ```
     public void stop() {
       if (!running.compareAndSet(true, false)) {
         LOG.warn("{} is not running, just ignore.", THREAD_NAME);
         return;
       }
   
       LOG.info("Stopping {}.", THREAD_NAME);
   
       // in case RatisPipelineUtilsThread is sleeping
       synchronized (monitor) {
         monitor.notifyAll();
       }
   
       try {
         thread.join();  //  ----> Hangs here
       } catch (InterruptedException e) {
         LOG.warn("Interrupted during join {}.", THREAD_NAME);
         Thread.currentThread().interrupt();
       }
     }
   ```
   
   It is clearly hanging as the background thread did not exit, and I believe 
it is because `notify()` is being used to try to exit the thread, when it 
should really be interrupted. There is a chance that notify is called while the 
thread is not waiting, and if so, it will just fall back into the wait state 
and not exit until it wakes up again.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6658
   
   ## How was this patch tested?
   
   Validated slow test is now fast locally.
   


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