szetszwo commented on code in PR #3357:
URL: https://github.com/apache/ozone/pull/3357#discussion_r860482773
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java:
##########
@@ -148,8 +148,8 @@ public void stop() {
LOG.info("Stopping {}.", THREAD_NAME);
// in case RatisPipelineUtilsThread is sleeping
- synchronized (monitor) {
- monitor.notifyAll();
+ synchronized (this) {
+ thread.interrupt();
Review Comment:
We should remove "synchronized" since interrupt() does not require it.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java:
##########
@@ -80,7 +81,6 @@ public class BackgroundPipelineCreator implements SCMService {
* configured interval and tries to create pipelines.
*/
private Thread thread;
- private final Object monitor = new Object();
Review Comment:
I suggest to keep the private monitor field. It can avoid code outside this
class calling wait/notify/notifyAll.
--
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]