From 1b29c97008b4e2b90d5eb63dd8aa6cdf900d9436 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Wed, 5 Apr 2023 13:41:09 +0300 Subject: [PATCH] Edge Session - improved error logging in case general process is interrupred because of sync started --- .../server/service/edge/rpc/EdgeGrpcSession.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java index 1717fea812..729de18614 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java @@ -423,6 +423,7 @@ public final class EdgeGrpcSession implements Closeable { stopCurrentSendDownlinkMsgsTask(null); } } catch (Exception e) { + log.warn("[{}] Failed to send downlink msgs. Error msg {}", this.sessionId, e.getMessage(), e); stopCurrentSendDownlinkMsgsTask(e); } }; @@ -669,19 +670,18 @@ public final class EdgeGrpcSession implements Closeable { } private void interruptPreviousSendDownlinkMsgsTask() { - String msg = String.format("[%s] Previous send downlink future was not properly completed, stopping it now!", this.sessionId); - stopCurrentSendDownlinkMsgsTask(new RuntimeException(msg)); + log.info("[{}]Previous send downlink future was not properly completed, stopping it now!", this.sessionId); + stopCurrentSendDownlinkMsgsTask(new RuntimeException()); } private void interruptGeneralProcessingOnSync(TenantId tenantId, EdgeId edgeId) { - String msg = String.format("[%s][%s] Sync process started. General processing interrupted!", tenantId, edgeId); - stopCurrentSendDownlinkMsgsTask(new RuntimeException(msg)); + log.info("[{}][{}][{}] Sync process started. General processing interrupted!", this.sessionId, tenantId, edgeId); + stopCurrentSendDownlinkMsgsTask(new RuntimeException()); } public void stopCurrentSendDownlinkMsgsTask(Exception e) { if (sessionState.getSendDownlinkMsgsFuture() != null && !sessionState.getSendDownlinkMsgsFuture().isDone()) { if (e != null) { - log.warn(e.getMessage(), e); sessionState.getSendDownlinkMsgsFuture().setException(e); } else { sessionState.getSendDownlinkMsgsFuture().set(null);