Skip to content

Commit

Permalink
add missing exception handling within SPARQLProtocolWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Sep 22, 2023
1 parent e2baf7d commit 8f83893
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public CompletableFuture<Result> start() {
}, executor);
}

private ExecutionStats executeQuery(Duration timeout, boolean discardOnFailure) {
private ExecutionStats executeQuery(Duration timeout, boolean discardOnFailure) {
HttpExecutionResult result = executeHttpRequest(timeout);
Optional<Integer> statuscode = Optional.empty();
if (result.response().isPresent())
Expand All @@ -260,7 +260,12 @@ private ExecutionStats executeQuery(Duration timeout, boolean discardOnFailure)
this.responseBodybbaos = new BigByteArrayOutputStream();
}
}
this.responseBodybbaos.reset();

try {
this.responseBodybbaos.reset();
} catch (IOException e) {
this.responseBodybbaos = new BigByteArrayOutputStream();
}

if (!result.completed() && discardOnFailure) {
LOGGER.debug("{}\t:: Discarded execution, because the time limit has been reached: [queryID={}]", this, result.queryID);
Expand Down

0 comments on commit 8f83893

Please sign in to comment.