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

Marcus Hirt hirt at openjdk.org
Fri Dec 6 15:03:19 UTC 2024


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

>> Happy to get feedback
>
> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/PID1Rule.java line 94:
> 
>> 92: 	@Override
>> 93: 	public Collection<TypedResult<?>> getResults() {
>> 94: 		return Collections.emptyList();
> 
> configuration attributes and results should be empty in this case, or?

Hi Hendrik!

Great progress on the rule! Configuration attributes should be empty, since the rule is not configurable. For the result, you should at least return the score attribute (we'll make the API nicer for JMC 10), and even though we know the PID is one when the rule is triggering, perhaps we should add the PID attribute to the results as well. So, following the pattern of other rules, perhaps add:

	private static final Collection<TypedResult<?>> RESULT_ATTRIBUTES = Arrays
			.<TypedResult<?>> asList(TypedResult.SCORE, PID);

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

PR Review Comment: https://git.openjdk.org/jmc/pull/613#discussion_r1867692676


More information about the jmc-dev mailing list