Skip to content

Commit

Permalink
Merge pull request #54 from nlnwa/handle-worker-exceptions
Browse files Browse the repository at this point in the history
Handle all crawl queue worker exceptions
  • Loading branch information
johnerikhalse authored Nov 24, 2021
2 parents b8f8565 + 361c259 commit 30963d7
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ public void run() {
if (moved > 0) {
LOG.debug("{} CrawlExecutions moved from running state to timeout state", moved);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
LOG.error("Error running chg queue manager script", t);
t.printStackTrace();
System.exit(1);
}
}
};
Expand All @@ -93,8 +96,11 @@ public void run() {
p.sync();
LOG.debug("Deleted {} URIs from crawl queue", deleted);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
LOG.error("Error running chg queue manager script", t);
t.printStackTrace();
System.exit(1);
}
}
};
Expand Down Expand Up @@ -122,6 +128,11 @@ public void run() {

chgId = ctx.getJedis().lpop(CHG_TIMEOUT_KEY);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}
};
Expand All @@ -143,6 +154,9 @@ public void run() {
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}
};
Expand All @@ -154,6 +168,11 @@ public void run() {
frontier.getCrawlQueueManager().pause(DbService.getInstance().getExecutionsAdapter().getDesiredPausedState());
} catch (DbException e) {
LOG.warn("Could not read pause state", e);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}
};
Expand All @@ -177,6 +196,11 @@ public void run() {
LOG.warn("Could not update jobExecutionState", e);
}
});
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}
};
Expand Down

0 comments on commit 30963d7

Please sign in to comment.