gortiz commented on PR #20149: URL: https://github.com/apache/pinot/pull/20149#issuecomment-7107276134
I changed the lifecycle model in 77bde0ce53, so here is what changed since your last review. The shared, reference-counted recording is gone. Each `ContinuousJfrStarter` instance now owns its own recording, under the instance lock, and there is no static state left. The reference count caused most of the problems in the last two rounds: the leaked reference on a component restart, the lost exit dump on `close()`, and recordings that ran without an owner. JFR recordings with the same settings share the chunks in the repository. Measured on JDK 25: 3 recordings used 1.05 MB of repository, and a single one used 0.72 MB, so one recording per component costs little in a quickstart. A production JVM has only one component. Stopping a recording also works differently. The class no longer keeps the stopped recording open as `<name>-stopped`. That approach doubled the disk use, and only `jcmd` could read the data. Now the class dumps the recording to `<name>-<timestamp>.jfr` in the repository directory and then closes it. Each instance keeps only its last dump. A recording in memory has no data after `stop()`, so the dump happens before the stop. `close()` now stops and dumps the recording, except during a JVM shutdown. In that case it leaves the recording running, so the JFR shutdown hook still writes the `dumpOnExit` file. The class detects the shutdown with `Runtime.removeShutdownHook`, which throws `IllegalStateException` once the shutdown starts. I ran your repro again (`dumpOnExit=true`, `close()` in a shutdown hook) and got the exit dump in 20 of 20 runs. A rename (`pinot.jfr.name`) now changes the name of the running recording in place. The test class has 23 tests, and the PR description is updated. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
