Github user wujinhu commented on a diff in the pull request:
https://github.com/apache/incubator-eagle/pull/691#discussion_r89927959
--- Diff:
eagle-jpm/eagle-jpm-mr-running/src/main/java/org/apache/eagle/jpm/mr/running/parser/MRJobEntityCreationHandler.java
---
@@ -78,24 +78,36 @@ public boolean flush() {
eagleServiceConfig.username,
eagleServiceConfig.password);
client.getJerseyClient().setReadTimeout(eagleServiceConfig.readTimeoutSeconds *
1000);
- try {
- LOG.info("start to flush mr job entities, size {}",
entities.size());
- client.create(entities);
- LOG.info("finish flushing mr job entities, size {}",
entities.size());
- entities.clear();
- } catch (Exception e) {
- LOG.warn("exception found when flush entities, {}", e);
- e.printStackTrace();
- return false;
- } finally {
- client.getJerseyClient().destroy();
+
+ int count = 0;
+ boolean success = false;
+ while (count++ < MAX_RETRY_COUNT && !success) {
try {
- client.close();
+ LOG.info("start to flush mr job entities, size {}",
entities.size());
+ client.create(entities);
+ LOG.info("finish flushing mr job entities, size {}",
entities.size());
+ entities.clear();
+ success = true;
+ LOG.info("Success of flushing mr job entities");
} catch (Exception e) {
- // ignored exception
+ LOG.warn("exception found when flush entities, {}", e);
+ } finally {
+ client.getJerseyClient().destroy();
--- End diff --
I do not think this retry logic will work. If flush failed first time,
client will be destroyed or closed!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---