You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/02/06 03:24:06 UTC

[GitHub] [iotdb] yuqi1129 commented on a change in pull request #2635: [IOTDB-1148]fix the client leak of client pool&use remote schema cache when check timeseries exist or not

yuqi1129 commented on a change in pull request #2635:
URL: https://github.com/apache/iotdb/pull/2635#discussion_r571348918



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -623,13 +648,16 @@ public void setCoordinator(Coordinator coordinator) {
           result = SyncClientAdaptor
               .getUnregisteredMeasurements(client, partitionGroup.getHeader(), seriesList);
         } else {
-          SyncDataClient syncDataClient =
-              metaGroupMember.getClientProvider().getSyncDataClient(node,
-                  RaftServer.getReadOperationTimeoutMS());
-          result = syncDataClient.getUnregisteredTimeseries(partitionGroup.getHeader(), seriesList);
-          ClientUtils.putBackSyncClient(syncDataClient);
+          SyncDataClient syncDataClient = null;
+          try {
+            syncDataClient = metaGroupMember.getClientProvider().getSyncDataClient(node,
+                RaftServer.getReadOperationTimeoutMS());
+            result = syncDataClient
+                .getUnregisteredTimeseries(partitionGroup.getHeader(), seriesList);
+          } finally {
+            ClientUtils.putBackSyncClient(syncDataClient);

Review comment:
       What about getSyncDataClient throws exception and syncDataClient is null and at this circumstance is still null?
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org