-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MINOR] improvement(server) Add context to rpc audit log to output necessary context #2088
base: master
Are you sure you want to change the base?
Conversation
Test Results 2 840 files - 50 2 840 suites - 50 5h 32m 0s ⏱️ - 24m 35s For more details on these errors, see this check. Results for commit 5681cf6. ± Comparison against base commit 3b981ed. ♻️ This comment has been updated with latest results. |
c2f14a4
to
a651b0b
Compare
a651b0b
to
0414673
Compare
if (context == null) { | ||
context = contextPart; | ||
} else { | ||
this.context += ", " + contextPart; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange, from my thought, If want to record the whole up/downstream context tips. Maybe we need to introduce the dedicated Context class to record the all children context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this?
class Context {
string contextName;
List<Context> children;
}
getBlockIdsByPartitionId(requestPartitions, bitmap, res, blockIdLayout); | ||
RpcAuditContext.getRpcAuditContext() | ||
.ifPresent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifPresent is a good practise, because this avoids unnessary cpu cost if having the much string operations.
@@ -906,7 +908,7 @@ public void getShuffleResultForMultiPart( | |||
|
|||
auditContext.withAppId(appId).withShuffleId(shuffleId); | |||
auditContext.withArgs( | |||
"partitionsListSize=" + partitionsList.size() + ", blockIdLayout=" + blockIdLayout); | |||
"partitionsList=" + partitionsList + ", blockIdLayout=" + blockIdLayout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concern that the partitionsList will cost too much time. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
@@ -18,24 +18,33 @@ | |||
package org.apache.uniffle.common.audit; | |||
|
|||
import java.io.Closeable; | |||
import java.util.Optional; | |||
|
|||
import org.slf4j.Logger; | |||
|
|||
import org.apache.uniffle.common.rpc.StatusCode; | |||
|
|||
/** Context for rpc audit logging. */ | |||
public abstract class RpcAuditContext implements Closeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If having performance degression, can we disable this by config? @maobaolong I see some time consuming operations in the hotspot path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can disable the rpc audit log by rss.server.rpc.audit.log.enabled
and rss.coordinator.rpc.audit.log.enabled
What changes were proposed in this pull request?
(Please outline the changes and how this PR fixes the issue.)
Why are the changes needed?
(Please clarify why the changes are needed. For instance,
Fix: # (issue)
Does this PR introduce any user-facing change?
(Please list the user-facing changes introduced by your change, including
No.
How was this patch tested?
(Please test your changes, and provide instructions on how to test it: