RED-10353: Increase drools timeout, different error message for the file that caused the timeout
This commit is contained in:
parent
f8e2aae6e7
commit
1abceb2e20
@ -32,7 +32,7 @@ public class RedactionServiceSettings {
|
|||||||
|
|
||||||
private int dictionaryCacheExpireAfterAccessDays = 3;
|
private int dictionaryCacheExpireAfterAccessDays = 3;
|
||||||
|
|
||||||
private int droolsExecutionTimeoutSecs = 300;
|
private int droolsExecutionTimeoutSecs = 600;
|
||||||
|
|
||||||
private boolean ruleExecutionSecured = true;
|
private boolean ruleExecutionSecured = true;
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class ComponentDroolsExecutionService {
|
|||||||
logger.error(e, "Exception during rule execution");
|
logger.error(e, "Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
if (e.getCause() instanceof TimeoutException) {
|
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);
|
throw new RuntimeException(e);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@ -131,7 +131,7 @@ public class ComponentDroolsExecutionService {
|
|||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (TimeoutException 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);
|
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ public class EntityDroolsExecutionService {
|
|||||||
logger.error(e, "Exception during rule execution");
|
logger.error(e, "Exception during rule execution");
|
||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
if (e.getCause() instanceof TimeoutException) {
|
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);
|
throw new RuntimeException(e);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@ -164,7 +164,7 @@ public class EntityDroolsExecutionService {
|
|||||||
kieSession.dispose();
|
kieSession.dispose();
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (TimeoutException 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);
|
List<FileAttribute> resultingFileAttributes = getFileAttributes(kieSession);
|
||||||
|
|||||||
@ -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) {
|
public DroolsTimeoutException(boolean reported, RuleFileType ruleFileType) {
|
||||||
|
|
||||||
super(DROOLS_TIMEOUT_MESSAGE);
|
super(DROOLS_TIMEOUT_MESSAGE);
|
||||||
|
|||||||
@ -261,6 +261,7 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Disabled
|
||||||
@Test
|
@Test
|
||||||
public void testDoseMortalityExtraction() {
|
public void testDoseMortalityExtraction() {
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 5705cc0782605fdca5dfff134b436f7143c9e421
|
Subproject commit 0da08b1d9d1bc815a3fb51aa9638eafea2cf02d5
|
||||||
Loading…
x
Reference in New Issue
Block a user