Henry Robinson has posted comments on this change.

Change subject: IMPALA-3981: Fixed the bug of "Crash when access 
statestore/catalog memz webpage"
......................................................................


Patch Set 1:

I think we can do something a bit cleaner, after thinking about it. 

Everywhere that AddDefaultPathHandler() is called, there should be a 
MetricGroup* object that is the top-level metric group for the process. You can 
pass that into AddDefaultPathHandler() just like the process mem tracker, and 
use that to get at the JVM metrics - if they exist. 

To do that you should rewrite 

    webserver->RegisterUrlCallback("/memz","memz.tmpl",
        bind<void>(&MemUsageHandler, process_mem_tracker, _1, _2));

to something like

  auto callback = [metric_group, process_mem_tracker](const auto& args, auto* 
doc) {
    MemUsageHandler(process_mem_tracker, metric_group, args, doc);
  }
  webserver->RegisterUrlCallback("/memz", callback);

(This is using C++11's new lambda syntax which I find much cleaner than 
boost::bind).

You should deal with the cases where a) metric_group == NULL and b) there is no 
"jvm" subgroup in the metric group.

-- 
To view, visit http://gerrit.cloudera.org:8080/3998
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If59b10f20044d1a468f27810a3029fe18fb19f29
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Kathy Sun <[email protected]>
Gerrit-Reviewer: Henry Robinson <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-HasComments: No

Reply via email to