YARN-9821. NM hangs at serviceStop when ATSV2 Backend Hbase is Down. Contributed by Prabhu Joseph.

This commit is contained in:
Abhishek Modi 2019-09-09 14:26:00 +05:30
parent 387c332b64
commit 60af8793b4
1 changed files with 42 additions and 32 deletions

View File

@ -630,39 +630,49 @@ public class HBaseTimelineWriterImpl extends AbstractService implements
*/ */
@Override @Override
protected void serviceStop() throws Exception { protected void serviceStop() throws Exception {
if (entityTable != null) { boolean isStorageUp = true;
LOG.info("closing the entity table"); try {
// The close API performs flushing and releases any resources held storageMonitor.checkStorageIsUp();
entityTable.close(); } catch (IOException e) {
LOG.warn("Failed to close the timeline tables as Hbase is down", e);
isStorageUp = false;
} }
if (appToFlowTable != null) {
LOG.info("closing the app_flow table"); if (isStorageUp) {
// The close API performs flushing and releases any resources held if (entityTable != null) {
appToFlowTable.close(); LOG.info("closing the entity table");
} // The close API performs flushing and releases any resources held
if (applicationTable != null) { entityTable.close();
LOG.info("closing the application table"); }
applicationTable.close(); if (appToFlowTable != null) {
} LOG.info("closing the app_flow table");
if (flowRunTable != null) { // The close API performs flushing and releases any resources held
LOG.info("closing the flow run table"); appToFlowTable.close();
// The close API performs flushing and releases any resources held }
flowRunTable.close(); if (applicationTable != null) {
} LOG.info("closing the application table");
if (flowActivityTable != null) { applicationTable.close();
LOG.info("closing the flowActivityTable table"); }
// The close API performs flushing and releases any resources held if (flowRunTable != null) {
flowActivityTable.close(); LOG.info("closing the flow run table");
} // The close API performs flushing and releases any resources held
if (subApplicationTable != null) { flowRunTable.close();
subApplicationTable.close(); }
} if (flowActivityTable != null) {
if (domainTable != null) { LOG.info("closing the flowActivityTable table");
domainTable.close(); // The close API performs flushing and releases any resources held
} flowActivityTable.close();
if (conn != null) { }
LOG.info("closing the hbase Connection"); if (subApplicationTable != null) {
conn.close(); subApplicationTable.close();
}
if (domainTable != null) {
domainTable.close();
}
if (conn != null) {
LOG.info("closing the hbase Connection");
conn.close();
}
} }
storageMonitor.stop(); storageMonitor.stop();
super.serviceStop(); super.serviceStop();