You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/02/01 06:04:31 UTC

[GitHub] [ozone] GlenGeng commented on a change in pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

GlenGeng commented on a change in pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#discussion_r567581938



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerV2Impl.java
##########
@@ -411,8 +411,13 @@ public int minPipelineLimit(Pipeline pipeline) {
   @Override
   public void activatePipeline(PipelineID pipelineID)
       throws IOException {
-    stateManager.updatePipelineState(pipelineID.getProtobuf(),
-        HddsProtos.PipelineState.PIPELINE_OPEN);
+    lock.lock();
+    try{
+      stateManager.updatePipelineState(pipelineID.getProtobuf(),
+              HddsProtos.PipelineState.PIPELINE_OPEN);
+    }finally {

Review comment:
       indent.

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerV2Impl.java
##########
@@ -411,8 +411,13 @@ public int minPipelineLimit(Pipeline pipeline) {
   @Override
   public void activatePipeline(PipelineID pipelineID)
       throws IOException {
-    stateManager.updatePipelineState(pipelineID.getProtobuf(),
-        HddsProtos.PipelineState.PIPELINE_OPEN);
+    lock.lock();
+    try{
+      stateManager.updatePipelineState(pipelineID.getProtobuf(),
+              HddsProtos.PipelineState.PIPELINE_OPEN);
+    }finally {

Review comment:
       indent. ` } finally {`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org