RED-9837: Fixed not working timeout with endless loop in drools then block
This commit is contained in:
parent
00409584ee
commit
2ae8b0fbce
@ -104,8 +104,7 @@ public class ComponentDroolsExecutionService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
completableFuture.orTimeout(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS)
|
completableFuture.get(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS);
|
||||||
.get();
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
logger.error(e, "Exception during rule execution");
|
logger.error(e, "Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
@ -117,6 +116,8 @@ public class ComponentDroolsExecutionService {
|
|||||||
logger.error(e, "Exception during rule execution");
|
logger.error(e, "Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
} catch (TimeoutException e) {
|
||||||
|
throw new DroolsTimeoutException(e, false, RuleFileType.COMPONENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||||
|
|||||||
@ -142,8 +142,7 @@ public class EntityDroolsExecutionService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
completableFuture.orTimeout(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS)
|
completableFuture.get(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS);
|
||||||
.get();
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
logger.error(e,"Exception during rule execution");
|
logger.error(e,"Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
@ -155,6 +154,8 @@ public class EntityDroolsExecutionService {
|
|||||||
logger.error(e,"Exception during rule execution");
|
logger.error(e,"Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
} catch (TimeoutException e) {
|
||||||
|
throw new DroolsTimeoutException(e, false, RuleFileType.ENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user