File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
iotdb-client/session/src/main/java/org/apache/iotdb/session Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1053,7 +1053,18 @@ private boolean reconnect() {
10531053 if (session .endPointToSessionConnection == null ) {
10541054 session .endPointToSessionConnection = new ConcurrentHashMap <>();
10551055 }
1056- session .endPointToSessionConnection .put (session .defaultEndPoint , this );
1056+ session .endPointToSessionConnection .compute (
1057+ session .defaultEndPoint ,
1058+ (k , v ) -> {
1059+ if (v != null && v .transport != null && v .transport .isOpen ()) {
1060+ try {
1061+ v .close ();
1062+ } catch (IoTDBConnectionException e ) {
1063+ logger .warn ("close connection failed, {}" , e .getMessage ());
1064+ }
1065+ }
1066+ return this ;
1067+ });
10571068 break ;
10581069 }
10591070 }
You can’t perform that action at this time.
0 commit comments