RFR: 8196743: jstatd doesn't see new Java processes inside Docker container

Yasumasa Suenaga ysuenaga at openjdk.java.net
Thu May 6 23:57:51 UTC 2021


On Thu, 6 May 2021 20:41:40 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

> This is a merge request to fix the issue where a running jstatd does not see JVMs in docker containers started since the jstatd itself started.
> 
> jstatd was using the set of temp directories gathered on startup to scan for VMs, by reading their perfdata file.  That includes existing running VMs in docker instances using tmp dirs such as /proc/PID/root/tmp/.  But it needs to re-evaluate that set of temp dirs continually to see new VMs in docker containers.  Rescanning also means it "forgets" about tmp dirs which have disappeared, for containers that have shutdown, and it will now not be scanning those directories forever.
> 
> Have been testing this manually, watching jps connecting to jstatd and show newly created JVMs in docker containers come and go.  Running existing tests OK so far.

src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java line 79:

> 77:     public LocalVmManager(String user) {
> 78:         this.userName = user;
> 79:         setTempDirs();

Is this call necessary? It looks like we don't need to hold `tmpdirs` anymore. Can we remove `tmpdirs` from class member and can call `PerfDataFile.getTempDirectories()` directly at L138?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3908


More information about the serviceability-dev mailing list