eagle-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EAGLE-796) MRJobEntityCreationHandler flush need retry N times
Date Tue, 29 Nov 2016 02:09:58 GMT

    [ https://issues.apache.org/jira/browse/EAGLE-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703889#comment-15703889
] 

ASF GitHub Bot commented on EAGLE-796:
--------------------------------------

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!


> MRJobEntityCreationHandler flush need retry N times
> ---------------------------------------------------
>
>                 Key: EAGLE-796
>                 URL: https://issues.apache.org/jira/browse/EAGLE-796
>             Project: Eagle
>          Issue Type: Improvement
>            Reporter: JiJun Tang
>            Assignee: Lingang Deng
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message