Skip to content

Commit d30285a

Browse files
committed
try to createStatementIterator once more after exception before giving up
1 parent b423d47 commit d30285a

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,14 @@ public CloseableIteration<? extends Statement> getStatements(Resource subj, IRI
920920
try {
921921
return createStatementIterator(txn, subj, pred, obj, explicit, contexts);
922922
} catch (IOException e) {
923-
throw new SailException("Unable to get statements", e);
923+
try {
924+
logger.warn("Failed to get statements, retrying", e);
925+
// try once more before giving up
926+
Thread.yield();
927+
return createStatementIterator(txn, subj, pred, obj, explicit, contexts);
928+
} catch (IOException e2) {
929+
throw new SailException("Unable to get statements", e);
930+
}
924931
}
925932
}
926933

core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ public void testLotsOfValidationFailuresSnapshot() throws IOException {
356356
@Test
357357
public void testLotsOfValidationFailuresSerializableValidation() throws IOException {
358358
System.out.println("testLotsOfValidationFailuresSerializableValidation");
359+
Logger root = (Logger) LoggerFactory.getLogger(ShaclSailBaseConfiguration.class.getName());
360+
root.setLevel(Level.ERROR);
361+
359362
ShaclSail sail = new ShaclSail(getBaseSail());
360363

361364
sail.setParallelValidation(true);

0 commit comments

Comments
 (0)