voonhous commented on code in PR #19575:
URL: https://github.com/apache/hudi/pull/19575#discussion_r3863013178


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/metrics/DistributedRegistry.java:
##########
@@ -48,9 +51,17 @@ public String getName() {
   public void register(JavaSparkContext jsc) {
     if (!isRegistered()) {
       jsc.sc().register(this);
+      // Only when this call actually registers: stamping unconditionally 
would re-brand an accumulator
+      // bound to a dead context and mask the staleness this field exists to 
detect.
+      this.registeredAppId = jsc.sc().applicationId();
     }
   }
 
+  /** False when bound to a different (typically stopped) context, meaning it 
must be recreated. */
+  public boolean isRegisteredWith(JavaSparkContext jsc) {

Review Comment:
   The branch is already stacked for this: `ee961488` is the hardening on its 
own (`DistributedRegistry`, `getMetricRegistry`, `Registry` / 
`ExecutorMetricsContext` / `NoOpRegistry` and their four test classes, 811 
lines, nothing RLI-specific), with `8c4d0c96` and `8a71f719` on top. It fixes 
`hoodie.metrics.executor.enable` for `HoodieWrapperFileSystem` on master 
regardless of where the counter design (name resolution, instance scoping) ends 
up, so could `ee961488` plus the guard and remover hunks from `05a5243` go out 
first as #19063's PR 1, with this PR rebased on it? That is one `rebase -i` 
rather than a restack, and it lets the fix land even if the counters take 
another round.
   



-- 
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]

Reply via email to