Skip to content
Permalink
Browse files
7122: Rules evaluation never complete
Reviewed-by: jpbempel, hirt, hdafgard
  • Loading branch information
aptmac committed Jul 29, 2021
1 parent 68d5eec commit eafd075cd4189647737ccfb90bf7643a9b43d81a
Showing with 18 additions and 19 deletions.
  1. +18 −19 ...rg.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/RuleManager.java
@@ -135,30 +135,29 @@ protected IStatus run(IProgressMonitor monitor) {
resultsByTopicByRuleId.get(topic).put(rule.getId(), result);
updateListeners(result);
try {
if (RulesToolkit.matchesEventAvailabilityMap(items.getItems(), rule.getRequiredEvents())) {
if (RulesToolkit.matchesEventAvailabilityMap(items.getItems(), rule.getRequiredEvents())
&& shouldEvaluate(rule)) {
evaluatedRules.remove(rule.getClass());
RunnableFuture<IResult> future = rule.createEvaluation(items.getItems(), config::getValue,
resultProvider);
Thread runner = new Thread(future);
if (shouldEvaluate(rule)) {
runner.start();
while (true) {
if (monitor.isCanceled()) {
future.cancel(true);
runner.join();
result = ResultBuilder.createFor(rule, config::getValue).setSeverity(Severity.NA)
.setSummary(Messages.JFR_EDITOR_RULES_CANCELLED)
.addResult(RulesHtmlToolkit.FAILED, true).build();
evaluatedRules.put(rule.getClass(), Severity.NA);
break;
} else if (future.isDone()) {
result = future.get();
runner.join();
evaluatedRules.put(rule.getClass(), result.getSeverity());
break;
}
Thread.sleep(100);
runner.start();
while (true) {
if (monitor.isCanceled()) {
future.cancel(true);
runner.join();
result = ResultBuilder.createFor(rule, config::getValue).setSeverity(Severity.NA)
.setSummary(Messages.JFR_EDITOR_RULES_CANCELLED)
.addResult(RulesHtmlToolkit.FAILED, true).build();
evaluatedRules.put(rule.getClass(), Severity.NA);
break;
} else if (future.isDone()) {
result = future.get();
runner.join();
evaluatedRules.put(rule.getClass(), result.getSeverity());
break;
}
Thread.sleep(100);
}
} else {
result = ResultBuilder.createFor(rule, config::getValue).setSeverity(Severity.NA)

0 comments on commit eafd075

Please sign in to comment.