RED-10353: Increase drools timeout, different error message for the file that caused the timeout
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ public class RedactionServiceSettings {
|
||||
|
||||
private int dictionaryCacheExpireAfterAccessDays = 3;
|
||||
|
||||
private int droolsExecutionTimeoutSecs = 300;
|
||||
private int droolsExecutionTimeoutSecs = 600;
|
||||
|
||||
private boolean ruleExecutionSecured = true;
|
||||
|
||||
|
||||
+2
-2
@@ -123,7 +123,7 @@ public class ComponentDroolsExecutionService {
|
||||
logger.error(e, "Exception during rule execution");
|
||||
kieSession.dispose();
|
||||
if (e.getCause() instanceof TimeoutException) {
|
||||
throw new DroolsTimeoutException(e, false, RuleFileType.COMPONENT);
|
||||
throw new DroolsTimeoutException(String.format("The file %s caused a timeout",context.getFileId()), e, false, RuleFileType.COMPONENT);
|
||||
}
|
||||
throw new RuntimeException(e);
|
||||
} catch (InterruptedException e) {
|
||||
@@ -131,7 +131,7 @@ public class ComponentDroolsExecutionService {
|
||||
kieSession.dispose();
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
throw new DroolsTimeoutException(e, false, RuleFileType.COMPONENT);
|
||||
throw new DroolsTimeoutException(String.format("The file %s caused a timeout",context.getFileId()), e, false, RuleFileType.COMPONENT);
|
||||
}
|
||||
|
||||
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||
|
||||
+2
-2
@@ -156,7 +156,7 @@ public class EntityDroolsExecutionService {
|
||||
logger.error(e, "Exception during rule execution");
|
||||
kieSession.dispose();
|
||||
if (e.getCause() instanceof TimeoutException) {
|
||||
throw new DroolsTimeoutException(e, false, RuleFileType.ENTITY);
|
||||
throw new DroolsTimeoutException(String.format("The file %s caused a timeout",context.getFileId()), e, false, RuleFileType.ENTITY);
|
||||
}
|
||||
throw new RuntimeException(e);
|
||||
} catch (InterruptedException e) {
|
||||
@@ -164,7 +164,7 @@ public class EntityDroolsExecutionService {
|
||||
kieSession.dispose();
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
throw new DroolsTimeoutException(e, false, RuleFileType.ENTITY);
|
||||
throw new DroolsTimeoutException(String.format("The file %s caused a timeout",context.getFileId()), e, false, RuleFileType.ENTITY);
|
||||
}
|
||||
|
||||
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||
|
||||
+8
@@ -22,6 +22,14 @@ public class DroolsTimeoutException extends RuntimeException {
|
||||
}
|
||||
|
||||
|
||||
public DroolsTimeoutException(String message, Throwable cause, boolean reported, RuleFileType ruleFileType) {
|
||||
|
||||
super(message, cause);
|
||||
this.reported = reported;
|
||||
this.ruleFileType = ruleFileType;
|
||||
}
|
||||
|
||||
|
||||
public DroolsTimeoutException(boolean reported, RuleFileType ruleFileType) {
|
||||
|
||||
super(DROOLS_TIMEOUT_MESSAGE);
|
||||
|
||||
+1
@@ -261,6 +261,7 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
|
||||
}
|
||||
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testDoseMortalityExtraction() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user