Skip to content

Commit 8834f88

Browse files
committed
fixed resilience tests
1 parent 2953335 commit 8834f88

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vst/src/main/java/com/arangodb/vst/VstProtocol.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
package com.arangodb.vst;
2222

23+
import com.arangodb.ArangoDBException;
2324
import com.arangodb.internal.InternalRequest;
2425
import com.arangodb.internal.InternalResponse;
2526
import com.arangodb.internal.net.CommunicationProtocol;
@@ -45,6 +46,11 @@ public VstProtocol(final VstCommunicationAsync communication) {
4546

4647
@Override
4748
public CompletableFuture<InternalResponse> executeAsync(InternalRequest request, HostHandle hostHandle) {
49+
if (outgoingExecutor.isShutdown()) {
50+
CompletableFuture<InternalResponse> cf = new CompletableFuture<>();
51+
cf.completeExceptionally(new ArangoDBException("VstProtocol already closed!"));
52+
return cf;
53+
}
4854
return CompletableFuture.completedFuture(null)
4955
.thenComposeAsync(__ -> communication.execute(request, hostHandle), outgoingExecutor);
5056
}

0 commit comments

Comments
 (0)