+ completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>success()
+ .withResult(output).build());
+
+ executor.shutdown();
+ } catch (final ExecutionException e) {
+ LOG.error("Write transactions failed.", e.getCause());
+
+ completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
+ .withError(RpcError.ErrorType.APPLICATION, "Submit failed", e.getCause()).build());
+ } catch (InterruptedException | TimeoutException e) {
+ LOG.error("Write transactions failed.", e);
+
+ completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
+ .withError(RpcError.ErrorType.APPLICATION,
+ "Final submit was timed out by the test provider or was interrupted", e).build());
+
+ for (int i = 0; i < futures.size(); i++) {
+ final ListenableFuture<Void> future = futures.get(i);
+
+ try {
+ future.get(0, TimeUnit.NANOSECONDS);
+ } catch (final TimeoutException fe) {
+ LOG.warn("Future #{}/{} not completed yet", i, futures.size());
+ } catch (final ExecutionException fe) {
+ LOG.warn("Future #{}/{} failed", i, futures.size(), e.getCause());
+ } catch (final InterruptedException fe) {
+ LOG.warn("Interrupted while examining future #{}/{}", i, futures.size(), e);
+ }