-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-18364. All method metrics related to the RPC protocol should be initialized. #4624
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
Conversation
30c79ce
to
7f8eef0
Compare
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.
@zhangshuyan0 Thanks for your report and contribution. It makes sense to me. Just find that workflow report one conflict which should be fixed first.
cc @sunchao @jojochuang would you mind have another check? Thanks.
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.
LGTM (pending for resolving the conflicts). cc @xkrogen too
|
||
List<Class<?>> protocols = new ArrayList<>(); | ||
protocols.add(protocol); | ||
if (protocol.getDeclaredMethods().length == 0) { |
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.
make add some comments for this since it's not very obvious why we do it.
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.
ok. I'll add.
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.
Interesting to hear that we're passing the XXXProtocolPB
classes which don't declare any methods. I think when testing this I must have assumed we passed the XXXProtocol
or XXXTranslatorPB
classes, though it's been too long for me to remember.
Can you add testing for this? A simple test in TestMutableMetrics
would be beneficial to validate the method-handling logic; we can augment TestProtocol
there to have some inheritance to create a similar situation as real protocols.
If possible, I'd also love to see a higher-level test validating that it works on a real-world protocol, which should be broken by the current logic. Something like starting a NameNode, making one method call, and validating that metrics exist for all of the other methods in the protocol containing that method call.
.../hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/MutableRatesWithAggregation.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
Configuration conf = new HdfsConfiguration(); | ||
// setting heartbeat interval to 1 hour to prevent bpServiceActor sends | ||
// heartbeat periodically to NN during running test case, and bpServiceActor | ||
// only sends heartbeat once after startup | ||
conf.setTimeDuration(DFS_HEARTBEAT_INTERVAL_KEY, 1, TimeUnit.HOURS); | ||
MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); | ||
cluster.waitActive(); | ||
final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); |
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.
@zhangshuyan0 Thanks for your update. This unit test seems failed based on the yetus reports. Another side, this segment code located at TestNameNodeMetrics should be more proper? Thanks again.
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.
Agreed that this isn't the right place. Actually it seems like enhancing TestRPC#testRpcMetrics()
might be the best place? Or if we can't get it to work there, then I agree TestNameNodeMetrics
seems better.
f8d341e
to
b79ea58
Compare
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.
One very minor style comment, otherwise LGTM. The new test in TestNameNodeMetrics
is really nice and concise!
...p-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
LGTM. +1.
@xkrogen Would you mind to take another review? I will to check in this PR after you confirm. Thanks. |
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.
LGTM! Thanks for finding & fixing this.
Committed to trunk. Thanks @zhangshuyan0 for your works. Thanks @sunchao, @xkrogen for your nice reviews! |
…e initialized. (apache#4624). Contributed by Shuyan Zhang. Reviewed-by: Erik Krogen <xkrogen@apache.org> Reviewed-by: Chao Sun <sunchao@apache.org> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
…initialized.
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?