Skip to content

Commit

Permalink
Use daemon threads for connection backoff resetter (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitarb authored Nov 5, 2020
1 parent ca5111d commit 370bb6e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package io.temporal.serviceclient;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.grpc.Channel;
import io.grpc.ClientInterceptor;
import io.grpc.ClientInterceptors;
Expand Down Expand Up @@ -168,7 +169,12 @@ public WorkflowServiceStubsImpl(
}

private ScheduledExecutorService startConnectionBackoffResetter(Duration backoffResetFrequency) {
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
ScheduledExecutorService executor =
Executors.newSingleThreadScheduledExecutor(
new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat("ConnectionBackoffResetter-thread-%d")
.build());

executor.scheduleWithFixedDelay(
() -> {
Expand Down

0 comments on commit 370bb6e

Please sign in to comment.