You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Purshotam Shah (JIRA)" <ji...@apache.org> on 2014/08/26 08:58:57 UTC

[jira] [Updated] (OOZIE-1980) Sql error should not fail coord job

     [ https://issues.apache.org/jira/browse/OOZIE-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Purshotam Shah updated OOZIE-1980:
----------------------------------

    Description: 
We know that sql error is transient, it should not fail the job.
We should ignore the SQL error, so that next materialization cycle can pick the job.

{code}
protected void materialize() throws CommandException {
        Instrumentation.Cron cron = new Instrumentation.Cron();
        cron.start();
        try {
            materializeActions(false);
            updateJobMaterializeInfo(coordJob);
        }
        catch (CommandException ex) {
            LOG.warn("Exception occurred:" + ex.getMessage() + " Making the job failed ", ex);
            coordJob.setStatus(Job.Status.FAILED);
            coordJob.resetPending();
            // remove any materialized actions and slaEvents
            insertList.clear();
        }
        catch (Exception e) {
            LOG.error("Exception occurred:" + e.getMessage() + " Making the job failed ", e);
            coordJob.setStatus(Job.Status.FAILED);
            try {
                CoordJobQueryExecutor.getInstance().executeUpdate(CoordJobQuery.UPDATE_COORD_JOB_MATERIALIZE, coordJob);
            }
            catch (JPAExecutorException jex) {
                throw new CommandException(ErrorCode.E1011, jex);
            }
            throw new CommandException(ErrorCode.E1012, e.getMessage(), e);
        } finally {
            cron.stop();
            instrumentation.addCron(INSTRUMENTATION_GROUP, getName() + ".materialize", cron);
        }
    }

{code}

> Sql error should not fail coord job
> -----------------------------------
>
>                 Key: OOZIE-1980
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1980
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Purshotam Shah
>
> We know that sql error is transient, it should not fail the job.
> We should ignore the SQL error, so that next materialization cycle can pick the job.
> {code}
> protected void materialize() throws CommandException {
>         Instrumentation.Cron cron = new Instrumentation.Cron();
>         cron.start();
>         try {
>             materializeActions(false);
>             updateJobMaterializeInfo(coordJob);
>         }
>         catch (CommandException ex) {
>             LOG.warn("Exception occurred:" + ex.getMessage() + " Making the job failed ", ex);
>             coordJob.setStatus(Job.Status.FAILED);
>             coordJob.resetPending();
>             // remove any materialized actions and slaEvents
>             insertList.clear();
>         }
>         catch (Exception e) {
>             LOG.error("Exception occurred:" + e.getMessage() + " Making the job failed ", e);
>             coordJob.setStatus(Job.Status.FAILED);
>             try {
>                 CoordJobQueryExecutor.getInstance().executeUpdate(CoordJobQuery.UPDATE_COORD_JOB_MATERIALIZE, coordJob);
>             }
>             catch (JPAExecutorException jex) {
>                 throw new CommandException(ErrorCode.E1011, jex);
>             }
>             throw new CommandException(ErrorCode.E1012, e.getMessage(), e);
>         } finally {
>             cron.stop();
>             instrumentation.addCron(INSTRUMENTATION_GROUP, getName() + ".materialize", cron);
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)