adoroszlai commented on code in PR #4968:
URL: https://github.com/apache/ozone/pull/4968#discussion_r1242004822
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -219,25 +274,24 @@ public Pipeline createPipeline(ReplicationConfig
replicationConfig,
LOG.info(message);
throw new IOException(message);
}
+ }
+ private void addPipelineToManager(Pipeline pipeline)
+ throws IOException, TimeoutException {
acquireWriteLock();
- final Pipeline pipeline;
try {
- pipeline = pipelineFactory.create(replicationConfig,
- excludedNodes, favoredNodes);
stateManager.addPipeline(pipeline.getProtobufMessage(
ClientVersion.CURRENT_VERSION));
Review Comment:
`pipeline.getProtobufMessage` can now be moved outside the locked section.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -219,25 +274,24 @@ public Pipeline createPipeline(ReplicationConfig
replicationConfig,
LOG.info(message);
throw new IOException(message);
}
+ }
+ private void addPipelineToManager(Pipeline pipeline)
+ throws IOException, TimeoutException {
acquireWriteLock();
- final Pipeline pipeline;
try {
- pipeline = pipelineFactory.create(replicationConfig,
- excludedNodes, favoredNodes);
stateManager.addPipeline(pipeline.getProtobufMessage(
ClientVersion.CURRENT_VERSION));
} catch (IOException | TimeoutException ex) {
- LOG.debug("Failed to create pipeline with replicationConfig {}.",
- replicationConfig, ex);
+ LOG.debug("Failed to add pipeline with replicationConfig {}.",
+ pipeline.getReplicationConfig(), ex);
Review Comment:
Nit: we may want to log the pipeline itself. Previously this was called
with a fresh pipeline, but now `pipeline` can be "anything".
--
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]