jsbali commented on a change in pull request #3364:
URL: https://github.com/apache/hudi/pull/3364#discussion_r679515765
##########
File path:
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HoodieHiveClient.java
##########
@@ -295,7 +295,7 @@ public void close() {
try {
ddlExecutor.close();
if (client != null) {
- client.close();
+ Hive.closeCurrent();
client = null;
Review comment:
We get a new hms client as follows
`Hive.get(configuration).getMSC(); `
which creates the client and saves it in a ThreadLocal map as well.
So if we ask for hms client at multiple places then close can only be called
on the client only once.
So we resort to
`Hive.closeCurrent()`
which first checks in the ThreadLocal map and if the client is there, then
only tries to close it. So further invocations don't throw exceptions
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]