sumitagrawl commented on code in PR #3782:
URL: https://github.com/apache/ozone/pull/3782#discussion_r988740996
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java:
##########
@@ -1137,45 +351,21 @@ public void stopBalancer()
TimeoutException {
lock.lock();
try {
- // should be leader, out of safe mode, and currently running
validateState(true);
- saveConfiguration(config, false, 0);
Review Comment:
> saveConfiguration could end up happening outside lock if executed in the
ContainerBalancerTask.
This is synchronized based on running status control,
1. saveConfiguration is called when ContainerBalancerTask is not running
during start of task from CLI (as applicable for only CLI to mark).
2. ContainerBalancerTask call saveContainer during Stopping state, when task
is about to close / stop.
Considering above sync, lock is avoided from ContainerBalancerTask.
--
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]