Integrated: 8307526: [JFR] Better handling of tampered JFR repository
Joakim Nordström
jnordstrom at openjdk.org
Wed Jul 5 22:30:05 UTC 2023
On Wed, 7 Jun 2023 14:48:52 GMT, Joakim Nordström <jnordstrom at openjdk.org> wrote:
> This change makes sure that "JFR Periodic Task" isn't interrupted by any errors. This can happen when an unfinished chunkfile is removed "in-flight", which would lead to the chunkfiles not being rotated properly, and the maxsize/maxage being ignored.
>
> With this fix, when an unfinished chunkfile is detected, all of the chunkfiles in the recording are checked for existence (since one likely cause for this could be f.i. 'rm -r /tmp' being invoked, effectively deleting all chunkfiles). Upon seeing missing chunkfiles, an error is logged, and emitted to the recording to signal that some data might be missing.
> A check to catch any missing chunkfiles is also added when dumping a recording -- this can happen if only finished chunkfiles have been removed, which is not detected in-flight.
>
> Also, a check was added to the file purger to check whether the file had already been deleted to not fill the purge list with already removed files.
>
> ### Testing
> - [x] tier1-3
> - [x] jdk_jfr
This pull request has now been integrated.
Changeset: 66d27365
Author: Joakim Nordström <jnordstrom at openjdk.org>
Committer: Erik Gahlin <egahlin at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/66d2736521611fbe7652356894d046c17d7cf743
Stats: 144 lines in 8 files changed: 102 ins; 8 del; 34 mod
8307526: [JFR] Better handling of tampered JFR repository
Reviewed-by: egahlin
-------------
PR: https://git.openjdk.org/jdk/pull/14360
More information about the hotspot-jfr-dev
mailing list