Skip to content

Commit

Permalink
Handle some SQL connectivity issues that weren't returning non-zero c…
Browse files Browse the repository at this point in the history
…odes. #94
  • Loading branch information
dstreev committed Nov 29, 2023
1 parent 3053559 commit 4fbdcaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/cloudera/utils/hadoop/hms/Mirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,8 @@ public long init(String[] args) {
}
} catch (SQLException cnfe) {
LOG.error("Issue initializing connections. Check driver locations", cnfe);
throw new RuntimeException(cnfe);
return -1;
// throw new RuntimeException(cnfe);
}

getConfig().getCluster(Environment.LEFT).setPools(connPools);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ protected void loadTablePartitionMetadata(String database, EnvironmentTable envT
envTable.setPartitions(partDef);

}
} catch (SQLException throwables) {
envTable.addIssue(throwables.getMessage());
LOG.error(getEnvironment() + ":" + database + "." + envTable.getName() +
": Issue loading Partitions.", throwables);
} finally {
if (resultSet != null) {
try {
Expand Down Expand Up @@ -830,7 +834,9 @@ protected void loadTablePartitionMetadataDirect(String database, EnvironmentTabl
LOG.debug(getEnvironment() + ":" + database + "." + envTable.getName() +
": Loaded Partitions from Metastore Direct Connection.");
} catch (SQLException throwables) {
throwables.printStackTrace();
envTable.addIssue(throwables.getMessage());
LOG.error(getEnvironment() + ":" + database + "." + envTable.getName() +
": Issue loading Partitions from Metastore Direct Connection.", throwables);
} finally {
try {
if (conn != null)
Expand Down

0 comments on commit 4fbdcaf

Please sign in to comment.