diff --git a/src/Apache.IoTDB/SessionPool.cs b/src/Apache.IoTDB/SessionPool.cs index fc2eca0..13a05fc 100644 --- a/src/Apache.IoTDB/SessionPool.cs +++ b/src/Apache.IoTDB/SessionPool.cs @@ -157,9 +157,12 @@ protected internal SessionPool(List nodeUrls, string username, string pa public async Task ExecuteClientOperationAsync(AsyncOperation operation, string errMsg, bool retryOnFailure = true, bool putClientBack = true) { Client client = _clients.Take(); + bool shouldReturnClient = true; + bool operationSucceeded = false; try { var resp = await operation(client); + operationSucceeded = true; return resp; } catch (TException ex) @@ -169,16 +172,25 @@ public async Task ExecuteClientOperationAsync(AsyncOperation ExecuteClientOperationAsync(AsyncOperation