RFR: 8296: No Java process should ever be PID 1

Henrik Dafgård hdafgard at openjdk.org
Fri Dec 6 15:03:18 UTC 2024


On Sat, 30 Nov 2024 23:30:31 GMT, Hendrik <duke at openjdk.org> wrote:

> Happy to get feedback

This looks good to me, just a few suggestions before we can go ahead and merge this. You also need to change the title of the PR to `8296: No Java process should ever be PID 1`

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/PID1Rule.java line 80:

> 78: 			return ResultBuilder.createFor(this, valueProvider).setSeverity(Severity.WARNING)
> 79: 					.setSummary(Messages.getString(Messages.PID1Rule_TEXT_INFO))
> 80: 					.setExplanation(Messages.getString(Messages.PID1Rule_TEXT_INFO_LONG)).build();

I'd also appreciate a potential solution for what the user can try to do if they end up in this case.

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties line 649:

> 647: PID1Rule_TEXT_OK=No Process runs with PID 1.
> 648: PID1Rule_TEXT_INFO=Process runs with PID 1.
> 649: PID1Rule_TEXT_INFO_LONG=Java processes shouldn't run with PID 1 as this PID is for the init process in Unix-like systems and receives special treatment.

I think this explanatory text can be improved, more like what Marcus wrote in the issue tracking this.

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

PR Review: https://git.openjdk.org/jmc/pull/613#pullrequestreview-2479599138
PR Review Comment: https://git.openjdk.org/jmc/pull/613#discussion_r1870105721
PR Review Comment: https://git.openjdk.org/jmc/pull/613#discussion_r1870105248


More information about the jmc-dev mailing list