Copilot commented on code in PR #50039: URL: https://github.com/apache/doris/pull/50039#discussion_r2047876751
########## fe/fe-core/src/main/java/org/apache/doris/datasource/hive/ThriftHMSCachedClient.java: ########## @@ -666,15 +672,44 @@ public void setThrowable(Throwable throwable) { this.throwable = throwable; } + public void setClientInPool(boolean clientInPool) { + isClientInPool = clientInPool; + } + + // For testing only + public boolean isInPool() { + return isClientInPool; + } + + // For testing only + public boolean isClosed() { + return isClosed; + } + + // For testing only + public IMetaStoreClient getClient() { + return client; + } + @Override public void close() throws Exception { + boolean retured = false; synchronized (clientPool) { - if (isClosed || throwable != null || clientPool.size() > poolSize) { - client.close(); - } else { + if (throwable == null && clientPool.size() < poolSize) { clientPool.offer(this); + this.isClientInPool = true; + retured = true; Review Comment: The variable 'retured' appears to be a typo. Consider renaming it to 'returned' for clarity. -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org