# Retry InterruptedException

**URL:** <https://discuss.dgraph.io/t/retry-interruptedexception/7772>\
**Category:** Dgraph Clients\
**Tags:** dgraph4j, accepted\
**Created:** [July 1, 2020, 10:18pm UTC](https://discuss.dgraph.io/t/retry-interruptedexception/7772 "2020-07-01T22:18:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [July 1, 2020, 10:18pm UTC](https://discuss.dgraph.io/t/retry-interruptedexception/7772/1 "2020-07-01T22:18:46Z")

</div>

_Posted by_ [martinmr](https://github.com/martinmr):

I am running the Jepsen tests and some of the tests are failing with this error:

```auto
ERROR [2020-07-01 22:11:46,650] ForkJoinPool.commonPool-worker-4 - io.dgraph.DgraphAsyncClient The doRequest got interrupted:
java.lang.InterruptedException: null
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:347) ~[na:1.8.0_222]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) ~[na:1.8.0_222]
        at io.dgraph.DgraphAsyncClient.lambda$runWithRetries$2(DgraphAsyncClient.java:180) ~[dgraph4j-2.0.2.jar:na]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ~[na:1.8.0_222]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582) ~[na:1.8.0_222]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[na:1.8.0_222]
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[na:1.8.0_222]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[na:1.8.0_222]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[na:1.8.0_222]

```

The relevant section in the code (in DgraphAsyncClient) is:

```auto
 try {
            return ctxCallable.call().get();
          } catch (InterruptedException e) {
            LOG.error("The " + operation + " got interrupted:", e);
            throw new RuntimeException(e);
          } catch (ExecutionException e) {
            if (ExceptionUtil.isJwtExpired(e.getCause())) {
              try {
                // retry the login

```

I think InterruptedException should cause the operation to be retried to make the Jepsen tests more resilient.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [July 7, 2020, 4:38pm UTC](https://discuss.dgraph.io/t/retry-interruptedexception/7772/2 "2020-07-07T16:38:41Z")

</div>

[abhimanyusinghgaur](https://github.com/abhimanyusinghgaur) _commented_ :

Closing this as Jepsen may be causing the interrupted exception, and we should not change the client behaviour for that as once interrupted, the client should just terminate as soon as possible.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [July 11, 2020, 1:44am UTC](https://discuss.dgraph.io/t/retry-interruptedexception/7772/3 "2020-07-11T01:44:29Z")

</div>

Closed on July 11, 2020, 1:44am UTC


