Skip to content

Commit 1e6c225

Browse files
HDFS-17783. [ARR] Optimize the debug log of method asyncIpcClient to print concrete call info. (#7686). Contributed by hfutatzhanghb.
Reviewed-by: He Xiaoqiao <[email protected]> Reviewed-by: Shilun Fan <[email protected]> Signed-off-by: Jian Zhang <[email protected]>
1 parent a21927a commit 1e6c225

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/protocolPB/AsyncRpcProtocolPBUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.hadoop.ipc.Client;
2727
import org.apache.hadoop.ipc.ProtobufRpcEngine2;
2828
import org.apache.hadoop.ipc.ProtobufRpcEngineCallback2;
29+
import org.apache.hadoop.ipc.Server;
2930
import org.apache.hadoop.ipc.internal.ShadedProtobufHelper;
3031
import org.apache.hadoop.thirdparty.protobuf.Message;
3132
import org.apache.hadoop.util.concurrent.AsyncGet;
@@ -93,6 +94,8 @@ public static <T, R> R asyncIpcClient(
9394
}
9495
try {
9596
T res = asyncReqMessage.get(-1, null);
97+
LOG.debug("Async IPC Request, Call={}, CallerContext={}, Result={}",
98+
Server.getCurCall().get(), CallerContext.getCurrent(), res);
9699
return response.apply(res);
97100
} catch (Exception ex) {
98101
throw warpCompletionException(ex);

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ThreadLocalContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public ThreadLocalContext() {
7575
* that the task execution reflects the state of the original calling thread.
7676
*/
7777
public void transfer() {
78+
Server.getCurCall().set(null);
7879
if (call != null) {
7980
Server.getCurCall().set(call);
8081
}

0 commit comments

Comments
 (0)