Truncate to length 15 instead of 10

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-01-06 21:13:37 -05:00
parent 1497b5ed6a
commit 4888ae15ea
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
2 changed files with 4 additions and 4 deletions

View File

@ -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-" + Utilities.toTruncatedString(uid, 10)); Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(uid, 15));
while (!stopped && !Thread.currentThread().isInterrupted()) { while (!stopped && !Thread.currentThread().isInterrupted()) {
if (!threadNameSet && getPeersNodeAddressOptional().isPresent()) { if (!threadNameSet && getPeersNodeAddressOptional().isPresent()) {
Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(getPeersNodeAddressOptional().get().getFullAddress(), 10)); Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(getPeersNodeAddressOptional().get().getFullAddress(), 15));
threadNameSet = true; threadNameSet = true;
} }
try { try {

View File

@ -141,7 +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-" + Utilities.toTruncatedString(peersNodeAddress.getFullAddress(), 10)); Thread.currentThread().setName("NetworkNode.connectionExecutor:SendMessage-to-" + Utilities.toTruncatedString(peersNodeAddress.getFullAddress(), 15));
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");
} }
@ -304,7 +304,7 @@ 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-" + Utilities.toTruncatedString(id, 10)); Thread.currentThread().setName("NetworkNode:SendMessage-to-" + Utilities.toTruncatedString(id, 15));
connection.sendMessage(networkEnvelope); connection.sendMessage(networkEnvelope);
return connection; return connection;