mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Add uid to thread name, shorten address in thread name
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
d3c573fc55
commit
1497b5ed6a
@ -707,10 +707,10 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Thread.currentThread().setName("InputHandler");
|
Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(uid, 10));
|
||||||
while (!stopped && !Thread.currentThread().isInterrupted()) {
|
while (!stopped && !Thread.currentThread().isInterrupted()) {
|
||||||
if (!threadNameSet && getPeersNodeAddressOptional().isPresent()) {
|
if (!threadNameSet && getPeersNodeAddressOptional().isPresent()) {
|
||||||
Thread.currentThread().setName("InputHandler-" + getPeersNodeAddressOptional().get().getFullAddress());
|
Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(getPeersNodeAddressOptional().get().getFullAddress(), 10));
|
||||||
threadNameSet = true;
|
threadNameSet = true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -141,8 +141,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||||||
|
|
||||||
SettableFuture<Connection> resultFuture = SettableFuture.create();
|
SettableFuture<Connection> resultFuture = SettableFuture.create();
|
||||||
ListenableFuture<Connection> future = connectionExecutor.submit(() -> {
|
ListenableFuture<Connection> future = connectionExecutor.submit(() -> {
|
||||||
Thread.currentThread().setName("NetworkNode.connectionExecutor:SendMessage-to-" + peersNodeAddress.getFullAddress());
|
Thread.currentThread().setName("NetworkNode.connectionExecutor:SendMessage-to-" + Utilities.toTruncatedString(peersNodeAddress.getFullAddress(), 10));
|
||||||
|
|
||||||
if (peersNodeAddress.equals(getNodeAddress())) {
|
if (peersNodeAddress.equals(getNodeAddress())) {
|
||||||
log.warn("We are sending a message to ourselves");
|
log.warn("We are sending a message to ourselves");
|
||||||
}
|
}
|
||||||
@ -305,7 +304,8 @@ public abstract class NetworkNode implements MessageListener {
|
|||||||
try {
|
try {
|
||||||
ListenableFuture<Connection> future = executor.submit(() -> {
|
ListenableFuture<Connection> future = executor.submit(() -> {
|
||||||
String id = connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get().getFullAddress() : connection.getUid();
|
String id = connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get().getFullAddress() : connection.getUid();
|
||||||
Thread.currentThread().setName("NetworkNode:SendMessage-to-" + id);
|
Thread.currentThread().setName("NetworkNode:SendMessage-to-" + Utilities.toTruncatedString(id, 10));
|
||||||
|
|
||||||
connection.sendMessage(networkEnvelope);
|
connection.sendMessage(networkEnvelope);
|
||||||
return connection;
|
return connection;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user