arp7 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_r278759705
##########
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);
Review comment:
Don't log here, just throw IOException that wraps the ExecutionException.
----------------------------------------------------------------
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]