otterc commented on code in PR #2123:
URL:
https://github.com/apache/incubator-celeborn/pull/2123#discussion_r1412826915
##########
common/src/main/java/org/apache/celeborn/common/network/server/TransportRequestHandler.java:
##########
@@ -73,8 +76,64 @@ public void channelInactive() {
@Override
public void handle(RequestMessage request) {
+ logger.trace("Received request {} from {}", request.getClass().getName(),
reverseClient);
if (checkRegistered(request)) {
- msgHandler.receive(reverseClient, request);
+ if (request instanceof RpcRequest) {
+ processRpcRequest((RpcRequest) request);
+ } else if (request instanceof OneWayMessage) {
+ processOneWayMessage((OneWayMessage) request);
+ } else {
+ processOtherMessages(request);
+ }
+ }
+ }
+
+ private void processRpcRequest(final RpcRequest req) {
+ try {
+ logger.trace("Process rpc request {}", req.requestId);
+ msgHandler.receive(
+ reverseClient,
+ req,
+ new RpcResponseCallback() {
+ @Override
+ public void onSuccess(ByteBuffer response) {
+ respond(new RpcResponse(req.requestId, new
NioManagedBuffer(response)));
+ }
+
+ @Override
+ public void onFailure(Throwable e) {
+ respond(new RpcFailure(req.requestId,
Throwables.getStackTraceAsString(e)));
+ }
+ });
+ } catch (Exception e) {
+ logger.error("Error while invoking handler#receive() on RPC id " +
req.requestId, e);
+ respond(new RpcFailure(req.requestId,
Throwables.getStackTraceAsString(e)));
Review Comment:
I think `CelebornIOException` is thrown from the server when handling
specifically the push and fetch requests (new to Celeborn so not sure). When
handling the rpc requests, the handlers were not wrapping these exceptions. You
can check the change in the `NettyRpcHandler` it was doing exactly the above. I
don't intend to modify the current behavior with this PR.
--
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]