Mrinal
Mrinal

Reputation: 1906

oozie job keeps executing again and again

I am very new to oozie. I have an oozie workflow which should execute once a day (as it is scheduled like: 0 4 * * *) but it keeps executing as in the job is getting submitted again within 5-6 seconds once it is completed. Here is the story:- It was executing at the scheduled time but it was failing due to wrong values of params (3rd and 4th in the below list):

${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'YYYY')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'MM')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -2, 'DAY'), 'w')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -2, 'DAY'), 'YYYYww')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'yyyy-MM-dd 00:00:00')}

The 3rd and 4th should pick up current week number - 2 like if the current week no of the year is 47 it should pick up 45. For the rest of the params it should pick up values for the previous day. So I thought that 3rd and 4th are wrong and first I tried this:

${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'YYYY')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'MM')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -2, 'WEEK'), 'w')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -2, 'WEEK'), 'YYYYww')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'yyyy-MM-dd 00:00:00')}

but didn't work out. So I changed them to this:

${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'YYYY')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'MM')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -14, 'DAY'), 'w')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -14, 'DAY'), 'YYYYww')}
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'yyyy-MM-dd 00:00:00')}

Now the job is not failing but the issue what I mentioned above is killing me. I tried to roll back but didn't work out. Even I tried to stop it by deleting the scheduler for it but still the same. Any idea what might have gone wrong? I use oozie with HUE.

Upvotes: 1

Views: 350

Answers (1)

Mrinal
Mrinal

Reputation: 1906

I have got the solution rather understanding here about how Oozie with HUE works which helped me solve the issue.

Look for the this part (along with a lot of other important informations): If you set the start time of the workflow to be in the past, then Oozie will happily schedule the workflow to run multiple times back to back until it catches up to the current time.

Upvotes: 1

Related Questions