waitinfuture commented on code in PR #1978:
URL:
https://github.com/apache/incubator-celeborn/pull/1978#discussion_r1357714633
##########
common/src/main/java/org/apache/celeborn/common/network/client/TransportResponseHandler.java:
##########
@@ -70,6 +70,8 @@ public class TransportResponseHandler extends
MessageHandler<ResponseMessage> {
private static ScheduledExecutorService fetchTimeoutChecker = null;
private ScheduledFuture fetchCheckerScheduleFuture;
+ private final Object handleFailureLock = new Object();
Review Comment:
IMO we don't need the lock here, because
`outstandingFetches/outstandingRpcs/outstandingPushes` are
`ConcurrentHashMap`s, they can guarantee `remove(requestId)` is atomic. Except
for `failOutstandingRequests`, the `callback` will only be called after it is
removed from the `ConcurrentHashMap`, so we only need to consider refactoring
`failOutstandingRequests`. IMO, we can loop over the key iterator, inside each
loop we call `remove(key)`, if the returned value is not null, call `onFailure`
on it.
##########
common/src/main/java/org/apache/celeborn/common/network/client/TransportClient.java:
##########
@@ -361,8 +359,7 @@ private class RpcChannelListener extends StdChannelListener
{
@Override
protected void handleFailure(String errorMsg, Throwable cause) {
- handler.removeRpcRequest(rpcRequestId);
- callback.onFailure(new IOException(errorMsg, cause));
+ handler.handleRpcFailure(rpcRequestId, errorMsg, cause);
Review Comment:
Seems we don't need `callback` anymore.
##########
common/src/main/java/org/apache/celeborn/common/network/client/TransportClient.java:
##########
@@ -393,8 +390,7 @@ public void operationComplete(Future<? super Void> future)
throws Exception {
@Override
protected void handleFailure(String errorMsg, Throwable cause) {
- handler.removePushRequest(pushRequestId);
- callback.onFailure(new CelebornIOException(errorMsg, cause));
+ handler.handlePushFailure(pushRequestId, errorMsg, cause);
Review Comment:
Seems we don't need `callback` anymore.
--
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]