diff --git a/framework/src/main/java/org/tron/common/logsfilter/nativequeue/NativeMessageQueue.java b/framework/src/main/java/org/tron/common/logsfilter/nativequeue/NativeMessageQueue.java index cf2fe6dce0a..e79a0973c1a 100644 --- a/framework/src/main/java/org/tron/common/logsfilter/nativequeue/NativeMessageQueue.java +++ b/framework/src/main/java/org/tron/common/logsfilter/nativequeue/NativeMessageQueue.java @@ -11,6 +11,7 @@ public class NativeMessageQueue { private static final int DEFAULT_BIND_PORT = 5555; private static final int DEFAULT_QUEUE_LENGTH = 1000; + private static final int ZMQ_SEND_TIME_OUT = 1_000; private static NativeMessageQueue instance; private ZContext context = null; private ZMQ.Socket publisher = null; @@ -33,7 +34,7 @@ public boolean start(int bindPort, int sendQueueLength) { if (Objects.isNull(publisher)) { return false; } - + publisher.setSendTimeOut(ZMQ_SEND_TIME_OUT); if (bindPort == 0 || bindPort < 0) { bindPort = DEFAULT_BIND_PORT; } diff --git a/framework/src/main/java/org/tron/core/net/P2pEventHandlerImpl.java b/framework/src/main/java/org/tron/core/net/P2pEventHandlerImpl.java index f6a01b1cf95..66774a216f2 100644 --- a/framework/src/main/java/org/tron/core/net/P2pEventHandlerImpl.java +++ b/framework/src/main/java/org/tron/core/net/P2pEventHandlerImpl.java @@ -222,10 +222,10 @@ private void processException(PeerConnection peer, TronMessage msg, Exception ex break; } if (type.equals(P2pException.TypeEnum.BAD_MESSAGE)) { - logger.error("Message from {} process failed, {} \n type: {}", + logger.error("Message from {} process failed, {} \n type: ({})", peer.getInetSocketAddress(), msg, type, ex); } else { - logger.warn("Message from {} process failed, {} \n type: {}, detail: {}", + logger.warn("Message from {} process failed, {} \n type: ({}), detail: {}", peer.getInetSocketAddress(), msg, type, ex.getMessage()); } } else {