Skip to content

Commit

Permalink
try to createStatementIterator once more after exception before givin…
Browse files Browse the repository at this point in the history
…g up
  • Loading branch information
hmottestad committed Jun 5, 2024
1 parent b423d47 commit d30285a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,14 @@ public CloseableIteration<? extends Statement> getStatements(Resource subj, IRI
try {
return createStatementIterator(txn, subj, pred, obj, explicit, contexts);
} catch (IOException e) {
throw new SailException("Unable to get statements", e);
try {
logger.warn("Failed to get statements, retrying", e);
// try once more before giving up
Thread.yield();
return createStatementIterator(txn, subj, pred, obj, explicit, contexts);
} catch (IOException e2) {
throw new SailException("Unable to get statements", e);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ public void testLotsOfValidationFailuresSnapshot() throws IOException {
@Test
public void testLotsOfValidationFailuresSerializableValidation() throws IOException {
System.out.println("testLotsOfValidationFailuresSerializableValidation");
Logger root = (Logger) LoggerFactory.getLogger(ShaclSailBaseConfiguration.class.getName());
root.setLevel(Level.ERROR);

ShaclSail sail = new ShaclSail(getBaseSail());

sail.setParallelValidation(true);
Expand Down

0 comments on commit d30285a

Please sign in to comment.