diff --git metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java index a6545a9..7e3ceef 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java @@ -201,9 +201,14 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } else { throw t; } - } catch (MetaException e) { - if (e.getMessage().matches("(?s).*(IO|TTransport)Exception.*") && - !e.getMessage().contains("java.sql.SQLIntegrityConstraintViolationException")) { + } catch (TException e) { + if (e instanceof TTransportException || e instanceof TProtocolException) { + caughtException = e; + } + else if (e instanceof MetaException && + (e.getMessage().matches("(?s).*(IO|TTransport)Exception.*") && + !e.getMessage().contains("java.sql.SQLIntegrityConstraintViolationException"))) { + caughtException = e; } else { throw e;