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:44:47 UTC
[GitHub] [ozone] amaliujia commented on a change in pull request #1861: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2
amaliujia commented on a change in pull request #1861:
URL: https://github.com/apache/ozone/pull/1861#discussion_r567593895
##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java
##########
@@ -557,10 +557,15 @@ public void triggerPipelineCreation() {
@Override
public void activatePipeline(PipelineID pipelineID)
throws IOException {
- Pipeline.PipelineState state = stateManager.
- getPipeline(pipelineID).getPipelineState();
- stateManager.activatePipeline(pipelineID);
- updatePipelineStateInDb(pipelineID, state);
+ lock.writeLock().lock();
+ try {
+ Pipeline.PipelineState state = stateManager.
+ getPipeline(pipelineID).getPipelineState();
+ stateManager.activatePipeline(pipelineID);
+ updatePipelineStateInDb(pipelineID, state);
+ }finally {
Review comment:
+1
----------------------------------------------------------------
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