Merge branch 'RED-9837-4.1' into 'release/4.348.x'

RED-9837: Fixed not working timeout with endless loop in drools then block

See merge request redactmanager/redaction-service!490
This commit is contained in:
Dominique Eifländer 2024-08-19 14:08:31 +02:00
commit 0692cc90e4
2 changed files with 6 additions and 4 deletions

View File

@ -95,8 +95,7 @@ public class ComponentDroolsExecutionService {
});
try {
completableFuture.orTimeout(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS)
.get();
completableFuture.get(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS);
} catch (ExecutionException e) {
kieSession.dispose();
if (e.getCause() instanceof TimeoutException) {
@ -106,6 +105,8 @@ public class ComponentDroolsExecutionService {
} catch (InterruptedException e) {
kieSession.dispose();
throw new RuntimeException(e);
} catch (TimeoutException e) {
throw new DroolsTimeoutException(e, false, RuleFileType.COMPONENT);
}
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);

View File

@ -129,8 +129,7 @@ public class EntityDroolsExecutionService {
});
try {
completableFuture.orTimeout(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS)
.get();
completableFuture.get(settings.getDroolsExecutionTimeoutSecs(document.getNumberOfPages()), TimeUnit.SECONDS);
} catch (ExecutionException e) {
kieSession.dispose();
if (e.getCause() instanceof TimeoutException) {
@ -140,6 +139,8 @@ public class EntityDroolsExecutionService {
} catch (InterruptedException e) {
kieSession.dispose();
throw new RuntimeException(e);
} catch (TimeoutException e) {
throw new DroolsTimeoutException(e, false, RuleFileType.ENTITY);
}
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);