cryostatio / cryostat-core

Core library providing a convenience wrapper and headless stubs for managing JFR with JDK Mission Control API
https://cryostat.io/
Other
8 stars 21 forks source link

[Bug] JFR operations require MissionControlMXBean #447

Open andrewazores opened 3 months ago

andrewazores commented 3 months ago

I think that probably explains the difference in behaviour for different operations, though. The Dashboard MBean Metrics views are powered by opening a JMX connection and directly invoking remote calls on various M(X)Beans, like the OperatingSystemMXBean or MemoryMXBean. JFR operations like starting a recording or listing .jfc event templates open a JMX connection and then go through a JMC library call stack, which I'm sure hits that HotspotManagementToolkit and therefore requires the MissionControl MXBean.

Originally posted by @andrewazores in https://github.com/cryostatio/cryostat/discussions/595#discussioncomment-10420440

andrewazores commented 3 months ago

TODO: investigate feasibility of removing the linked toolkit class from the call path. It doesn't seem like we really need the MissionControlMXBean for Cryostat's purposes.

Removing the JMC dependencies from the JFR management operation call paths would also do the job, but would be a very large refactoring job related to #223, #173.

Either directly reimplementing the operations, or using a simpler library like https://github.com/microsoft/jfr-streaming , could help.