RFR: 7248: JMC7/8 Automated Analysis taking very long time to produce results for Class Leak Rule. [v2]
Suchita Chaturvedi
schaturvedi at openjdk.java.net
Tue Jul 27 14:37:52 UTC 2021
On Wed, 21 Jul 2021 17:26:55 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
>> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/util/DefaultIItemResultSet.java line 134:
>>
>>> 132: }
>>> 133: // Higher timeout value added for worst case
>>> 134: exec.awaitTermination(1, TimeUnit.HOURS);
>>
>> It may be worth to make this value configurable. IE let hte use know that how long it will allow for the background job to run.
>>
>> Also, it may be worthy to actually enforce the shutdown once this delay is over. IE soemthing like that
>>
>>
>> try {
>> // allow for budget (default 1h) to process the aggregates
>> if(!exec.awaitTermination(delay, delayUnit)) {
>> exec.shutdownNow();
>> // last grace period
>> if (!pool.awaitTermination(1, TimeUnit.MINUTES)) {
>> // report an issue with the pool
>> }
>> }
>> } catch (InterruptedException e) {
>> Thread.currentThread().interrupt();
>> }
>>
>>
>> Also I think this code could moved in the same scope as the shutdown call.
>
> Agreed, let's add a preference. Also, the comment is not aligned with the implementation, seems it's set to 1 minute, not 1 hour.
@thegreystone Removed the hard-coding and added it as part of preferences. Please approve the changes if you feel its good to go now.
-------------
PR: https://git.openjdk.java.net/jmc/pull/248
More information about the jmc-dev
mailing list