From b1e16f27486f094d054f4844321a024b73891166 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Tue, 7 Feb 2023 11:58:10 +0100 Subject: [PATCH] Connection: Pass uid to executor service name --- .../main/java/bisq/network/p2p/network/Connection.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/p2p/src/main/java/bisq/network/p2p/network/Connection.java b/p2p/src/main/java/bisq/network/p2p/network/Connection.java index bafc38e7b6..096b59d176 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/Connection.java +++ b/p2p/src/main/java/bisq/network/p2p/network/Connection.java @@ -47,7 +47,6 @@ import com.google.protobuf.InvalidProtocolBufferException; import javax.inject.Inject; -import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Uninterruptibles; import javafx.beans.property.ObjectProperty; @@ -134,7 +133,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener { private final NetworkFilter networkFilter; @Getter private final String uid; - private final ExecutorService singleThreadExecutor = SingleThreadExecutorUtils.getSingleThreadExecutor(runnable -> new Thread(runnable, "Connection.java executor-service")); + private final ExecutorService singleThreadExecutor; @Getter private final Statistic statistic; @Getter @@ -180,7 +179,10 @@ public class Connection implements HasCapabilities, Runnable, MessageListener { this.socket = socket; this.connectionListener = connectionListener; this.networkFilter = networkFilter; - uid = UUID.randomUUID().toString(); + + this.uid = UUID.randomUUID().toString(); + this.singleThreadExecutor = SingleThreadExecutorUtils.getSingleThreadExecutor("Executor service for connection with uid " + uid); + statistic = new Statistic(); addMessageListener(messageListener);