# Busy infinite retrying: "Retrying after failure"

**URL:** <https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [June 14, 2021, 11:52pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385 "2021-06-14T23:52:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzz](https://avatars.discourse-cdn.com/v4/letter/z/cc9497/32.png) [@zzz](https://community.temporal.io/u/zzz)\
**Post date:** [June 14, 2021, 11:52pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385/1 "2021-06-14T23:52:29Z")

</div>

We are using temporal java SDK, and seeing this infinite retry loop happens every millisecs.

Stack trace:

```auto
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) ~[grpc-stub-1.35.0.jar:1.35.0]
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) ~[grpc-stub-1.35.0.jar:1.35.0]
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) ~[grpc-stub-1.35.0.jar:1.35.0]
	at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.respondActivityTaskCompleted(WorkflowServiceGrpc.java:2727) ~[temporal-serviceclient-1.0.5.jar:?]
	at io.temporal.internal.external.ManualActivityCompletionClientImpl.lambda$complete$0(ManualActivityCompletionClientImpl.java:110) ~[temporal-sdk-1.0.5.jar:?]
	at io.temporal.internal.common.GrpcRetryer.lambda$retry$0(GrpcRetryer.java:109) ~[temporal-sdk-1.0.5.jar:?]
	at io.temporal.internal.common.GrpcRetryer.retryWithResult(GrpcRetryer.java:127) ~[temporal-sdk-1.0.5.jar:?]
	at io.temporal.internal.common.GrpcRetryer.retry(GrpcRetryer.java:106) ~[temporal-sdk-1.0.5.jar:?]
	at io.temporal.internal.external.ManualActivityCompletionClientImpl.complete(ManualActivityCompletionClientImpl.java:104) ~[temporal-sdk-1.0.5.jar:?]
	at io.temporal.internal.sync.ActivityCompletionClientImpl.complete(ActivityCompletionClientImpl.java:44) ~[temporal-sdk-1.0.5.jar:?]

```

Is there a way to set max retry on this?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [June 15, 2021, 6:32pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385/2 "2021-06-15T18:32:43Z")

</div>

Hi @zzz we are looking into this internally to figure out if it’s a bug. As far as for now, could you try setting maximumAttempts on RpcRetryOptions?

Do you get these logs forever? The expiration set should have a max of 1 minute. Do you get it for longer?

---

<div class="post-metadata">

**Author:** ![zzz](https://avatars.discourse-cdn.com/v4/letter/z/cc9497/32.png) [@zzz](https://community.temporal.io/u/zzz)\
**Post date:** [June 15, 2021, 7:33pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385/3 "2021-06-15T19:33:51Z")

</div>

Yes, we have a 1 hour workflowRunTimeout on the workflow level, and the infinite retry was running for the whole one hour. We will try the maximumAttempts. Thanks!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [June 15, 2021, 9:01pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385/4 "2021-06-15T21:01:25Z")

</div>

Also from logs it shows you are on the Java SDK 1.0.5. Could you update to 1.0.9 ([Release v1.0.9 release · temporalio/sdk-java · GitHub](https://github.com/temporalio/sdk-java/releases/tag/v1.0.9)) and see if you get the same results? At least then we can be on the latest release (will be easier to debug stuff). Thanks!

---

<div class="post-metadata">

**Author:** ![zzz](https://avatars.discourse-cdn.com/v4/letter/z/cc9497/32.png) [@zzz](https://community.temporal.io/u/zzz)\
**Post date:** [June 15, 2021, 9:09pm UTC](https://community.temporal.io/t/busy-infinite-retrying-retrying-after-failure/2385/5 "2021-06-15T21:09:38Z")

</div>

Sure, I will update to 1.0.9. Actually in 1.0.5, RpcRetryOptions is not available as well. I will update here if we see this issue again
