[
https://issues.apache.org/jira/browse/HDDS-6658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated HDDS-6658:
-----------------------------
Component/s: SCM
> BackgroundPipelineCreator does not always stop quickly
> ------------------------------------------------------
>
> Key: HDDS-6658
> URL: https://issues.apache.org/jira/browse/HDDS-6658
> Project: Apache Ozone
> Issue Type: Improvement
> Components: SCM
> Reporter: Stephen O'Donnell
> Assignee: Stephen O'Donnell
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.3.0
>
>
> 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:
> {code}
> 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();
> }
> }
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]