Skip to content

Commit ba43ea3

Browse files
authored
HIVE-29600: Error message is too verbose in Metastore handler (apache#6465)
1 parent 55a5145 commit ba43ea3

2 files changed

Lines changed: 63 additions & 59 deletions

File tree

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/AbstractRequestHandler.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,16 @@ public RequestStatus getRequestStatus() throws TException {
232232
// The background handler thread was cancelled
233233
LOG.trace("{} The background handler was cancelled", logMsgPrefix);
234234
} catch (ExecutionException | InterruptedException e) {
235-
// No op, we will deal with this exception later
236-
LOG.error("{} Failed", logMsgPrefix, e);
237235
if (e.getCause() instanceof Exception ex && !aborted.get()) {
238236
throw handleException(ex).throwIfInstance(TException.class).defaultMetaException();
239237
}
240-
String errorMsg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
238+
Throwable t = e.getCause() != null ? e.getCause() : e;
239+
if (!(t instanceof TException)) {
240+
LOG.error("{} Failed", logMsgPrefix, t);
241+
} else if (LOG.isDebugEnabled()) {
242+
LOG.debug("{} Failed", logMsgPrefix, t);
243+
}
244+
String errorMsg = t.getMessage();
241245
throw new MetaException(logMsgPrefix + " failed with " + errorMsg);
242246
}
243247
return resp;

0 commit comments

Comments
 (0)