[
https://issues.apache.org/jira/browse/HDFS-16310?focusedWorklogId=682548&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-682548
]
ASF GitHub Bot logged work on HDFS-16310:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Nov/21 11:45
Start Date: 17/Nov/21 11:45
Worklog Time Spent: 10m
Work Description: tomscut commented on a change in pull request #3635:
URL: https://github.com/apache/hadoop/pull/3635#discussion_r751162479
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java
##########
@@ -586,25 +587,20 @@ private Object invokeMethod(
/**
* For tracking which is the actual client address.
- * It adds trace info "clientIp:ip" to caller context if it's absent.
+ * It adds trace info "clientIp:ip" and "clientPort:port"
+ * to caller context if they are absent.
*/
- private void appendClientIpToCallerContextIfAbsent() {
- String clientIpInfo = CLIENT_IP_STR + ":" + Server.getRemoteAddress();
- final CallerContext ctx = CallerContext.getCurrent();
- if (isClientIpInfoAbsent(clientIpInfo, ctx)) {
- String origContext = ctx == null ? null : ctx.getContext();
- byte[] origSignature = ctx == null ? null : ctx.getSignature();
- CallerContext.setCurrent(
- new CallerContext.Builder(origContext, contextFieldSeparator)
- .append(clientIpInfo)
- .setSignature(origSignature)
- .build());
- }
- }
-
- private boolean isClientIpInfoAbsent(String clientIpInfo, CallerContext ctx){
- return ctx == null || ctx.getContext() == null
- || !ctx.getContext().contains(clientIpInfo);
+ private void appendClientIpPortToCallerContextIfAbsent() {
+ CallerContext ctx = CallerContext.getCurrent();
+ String origContext = ctx == null ? null : ctx.getContext();
+ byte[] origSignature = ctx == null ? null : ctx.getSignature();
+ CallerContext.setCurrent(
+ new CallerContext.Builder(origContext, contextFieldSeparator)
+ .appendIfAbsent(CLIENT_IP_STR, Server.getRemoteAddress())
+ .appendIfAbsent(CLIENT_PORT_STR,
Review comment:
> Just a note, we allow the line length up to 100 after
[HADOOP-17813](https://issues.apache.org/jira/browse/HADOOP-17813).
Thank you for reminding me. This is good.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 682548)
Time Spent: 2.5h (was: 2h 20m)
> RBF: Add client port to CallerContext for Router
> ------------------------------------------------
>
> Key: HDFS-16310
> URL: https://issues.apache.org/jira/browse/HDFS-16310
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: tomscut
> Assignee: tomscut
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> We mentioned in [HDFS-16266|https://issues.apache.org/jira/browse/HDFS-16266]
> that adding the client port to the CallerContext of the Router.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]