bharatviswa504 commented on a change in pull request #714: HDDS-1406. Avoid
usage of commonPool in RatisPipelineUtils.
URL: https://github.com/apache/hadoop/pull/714#discussion_r278762154
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java
##########
@@ -146,19 +165,37 @@ private static void callRatisRpc(List<DatanodeDetails>
datanodes,
SecurityConfig(ozoneConf));
final TimeDuration requestTimeout =
RatisHelper.getClientRequestTimeout(ozoneConf);
- datanodes.parallelStream().forEach(d -> {
- final RaftPeer p = RatisHelper.toRaftPeer(d);
- try (RaftClient client = RatisHelper
- .newRaftClient(SupportedRpcType.valueOfIgnoreCase(rpcType), p,
- retryPolicy, maxOutstandingRequests, tlsConfig, requestTimeout))
{
- rpc.accept(client, p);
- } catch (IOException ioe) {
- String errMsg =
- "Failed invoke Ratis rpc " + rpc + " for " + d.getUuid();
- LOG.error(errMsg, ioe);
- exceptions.add(new IOException(errMsg, ioe));
- }
- });
+ try {
+ POOL.submit(() -> {
+ datanodes.parallelStream().forEach(d -> {
+ final RaftPeer p = RatisHelper.toRaftPeer(d);
+ try (RaftClient client = RatisHelper
+ .newRaftClient(SupportedRpcType.valueOfIgnoreCase(rpcType), p,
+ retryPolicy, maxOutstandingRequests, tlsConfig,
+ requestTimeout)) {
+ rpc.accept(client, p);
+ } catch (IOException ioe) {
+ String errMsg =
+ "Failed invoke Ratis rpc " + rpc + " for " + d.getUuid();
+ LOG.error(errMsg, ioe);
+ exceptions.add(new IOException(errMsg, ioe));
+ }
+ });
+ }).get();
+ } catch (ExecutionException ex) {
+ LOG.error("Execution exception occurred during createPipeline", ex);
+ throw new IOException("Execution exception occurred during " +
+ "createPipeline", ex);
+ } catch (RejectedExecutionException ex) {
+ LOG.error("RejectedExecutionException, occurred during " +
Review comment:
We return IOException, so in case of IOException we have no logging right?
It has only break;
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]