Hi,

When I try to close my HiveMetaStoreClient, it fails. Following is the code snippet from Hive code base which is responsible for closing the connection.

public void close() {
    isConnected = false;
    if ((transport != null) && transport.isOpen()) {
      transport.close();
    }
    try {
      if (null != client) {
        client.shutdown();
      }
    } catch (TException e) {
      // TODO:pc cleanup the exceptions
      LOG.error("Unable to shutdown local metastore client");
      LOG.error(e.getStackTrace());
      // throw new RuntimeException(e.getMessage());
    }

When client.shutdown() is called, it throws an exception:
org.apache.thrift.transport.TTransportException: Cannot write to null outputStream

Further the logging of error also mask the actual error. The logging just prints the Array object of stack-trace; hiding the actual problem.
Following are the logs:
ERROR [2012-08-09 15:36:04] (HiveMetaStoreClient.java:288) - Unable to shutdown local metastore client
ERROR [2012-08-09 15:36:06] (HiveMetaStoreClient.java:289) - [Ljava.lang.StackTraceElement;@8250825

Please let me know if I am making any mistake while closing the HiveMetaStoreClient.


Reply via email to