From 8bff1b598a46f572f10e523c13cdb7d214874d09 Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 6 May 2023 11:07:12 +0800 Subject: [PATCH 1/2] cp without resolving conflicts --- .../alluxio/worker/grpc/BlockReadHandler.java | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java b/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java index 3e5abac7edc5..387d5f463f63 100644 --- a/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java +++ b/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java @@ -464,12 +464,20 @@ private void runInternal() { } continue; } - if (error != null) { + if (eof || cancel || error != null) { try { completeRequest(mContext, false); } catch (Exception e) { - LOG.error("Failed to close the request.", e); + if (error != null) { + LOG.error("Failed to close the request.", e); + } else { + LogUtils.warnWithException(LOG, "Exception occurred while completing read request, " + + "EOF/CANCEL sessionId: {}. {}", mContext.getRequest().getSessionId(), + mContext.getRequest(), e); + error = new Error(AlluxioStatusException.fromThrowable(e), true); + } } +<<<<<<< HEAD replyError(error); } else if (eof || cancel) { try { @@ -482,11 +490,30 @@ private void runInternal() { setError(new Error(AlluxioStatusException.fromThrowable(e), true)); } if (eof) { +||||||| parent of f575e4fab5 (Fix the active rpc metrics) + replyError(error); + } else if (eof || cancel) { + try { + completeRequest(mContext); + } catch (Exception e) { + LogUtils.warnWithException(LOG, "Exception occurred while completing read request, " + + "EOF/CANCEL sessionId: {}. {}", mContext.getRequest().getSessionId(), + mContext.getRequest(), e); + setError(new Error(AlluxioStatusException.fromThrowable(e), true)); + } + if (eof) { +======= + if (error != null) { + replyError(error); + } else if (eof) { +>>>>>>> f575e4fab5 (Fix the active rpc metrics) replyEof(); - } else { + } else if (cancel) { replyCancel(); } } + // Leave `!mResponse.isReady() && tooManyPendingChunks()` unhandled + // since the reader is not finished in that case and needs more rounds } /** From c842053707b1c6d69283ae8e7191e6e23291df06 Mon Sep 17 00:00:00 2001 From: Rico Chiu Date: Mon, 22 Apr 2024 23:09:37 -0700 Subject: [PATCH 2/2] resolve conflict and compare with code in master-2.x --- .../alluxio/worker/grpc/BlockReadHandler.java | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java b/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java index 387d5f463f63..ed904b95a7eb 100644 --- a/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java +++ b/core/server/worker/src/main/java/alluxio/worker/grpc/BlockReadHandler.java @@ -466,7 +466,8 @@ private void runInternal() { } if (eof || cancel || error != null) { try { - completeRequest(mContext, false); + boolean success = !cancel && error == null; + completeRequest(mContext, success); } catch (Exception e) { if (error != null) { LOG.error("Failed to close the request.", e); @@ -477,36 +478,9 @@ private void runInternal() { error = new Error(AlluxioStatusException.fromThrowable(e), true); } } -<<<<<<< HEAD - replyError(error); - } else if (eof || cancel) { - try { - boolean success = !cancel; - completeRequest(mContext, success); - } catch (Exception e) { - LogUtils.warnWithException(LOG, "Exception occurred while completing read request, " - + "EOF/CANCEL sessionId: {}. {}", mContext.getRequest().getSessionId(), - mContext.getRequest(), e); - setError(new Error(AlluxioStatusException.fromThrowable(e), true)); - } - if (eof) { -||||||| parent of f575e4fab5 (Fix the active rpc metrics) - replyError(error); - } else if (eof || cancel) { - try { - completeRequest(mContext); - } catch (Exception e) { - LogUtils.warnWithException(LOG, "Exception occurred while completing read request, " - + "EOF/CANCEL sessionId: {}. {}", mContext.getRequest().getSessionId(), - mContext.getRequest(), e); - setError(new Error(AlluxioStatusException.fromThrowable(e), true)); - } - if (eof) { -======= if (error != null) { replyError(error); } else if (eof) { ->>>>>>> f575e4fab5 (Fix the active rpc metrics) replyEof(); } else if (cancel) { replyCancel();