I have job A that have time condition as 6:00 and predecessor as job B(this completes mostly by 4:00). Yesterday job B did not ran and today after job B completion job A started as time condition was satisfied on previous day itself. I want to know whether is there any way to make this time condition to be unsatisfied after that particular day completion so that there wont be any issues in next day?
If you are using R11 version, then you can use lookback condition(refer CA manual for details)
syntax is
status(job_name, hhhh.mm)
eg
condition: success(job_b,12.00)
If job_b has become success in last 12 hrs, then condition is satisfied, else its not and the job_a doesnt run.
Hope this will do.
Related
I have an airflow process that runs every Sunday at 12:00am. Is there a way to trigger this process exactly at the same time (absolute time) every week regardless of previous run duration or outcome. I see that the start time of the process keeps creeping forward to the point that after a couple of weeks it now gets triggered a full 16 hours later than the scheduled time. How do I make it start exactly at the same time regardless of the previous run outcome or whether previously triggerred manually or not (cron like behaviour) ?
Add depends_on_past argument in your DAG's default_args, false value will make sure new dagruns will be created every interval without depending on the previous dagrun status:
'depends_on_past': False
It might not be necessary, but I recommend restart your scheduler after making this change.
Predecessor job(JOB_A) running M-F
JOB_B is set up to run M-TH after JOB_A completion
We have job(JOB_C) that needs to run only on FRIDAY's after JOB_A completion.
Because of FRIDAY only we have to use DATE condition with DAY and TIME.
JOB_C is triggering at the Time and not waiting for the JOB_A completion.
(JOB_A dependent on another job so it may run any time between 19:00 to 23:00
job run time may be 5Min only)
Can Autosys handle this?
Regards
Please correct me if I misunderstood your problem.
From my understanding you want JOB_C to run on Friday, only after the completion of JOB_A in that case you can add the following attributes to the JIL of JOB_C
days_of_week: fr
conditions: s(JOB_A)
you can use conditions : d(JOB_A) if there is no actual dependency on JOB_A other than the order in which they run.
d(JOB_A) is for DONE, that will satisfy the condition as soon as JOB_A had completed irrespective of the exit status/code
s(JOB_A) is for SUCCESS, so it will only satisfy if JOB_A had completed successfully
You might want to have a dummy job, let's say JOB_D, just to indicate Friday. The command does not matter, what matter is the schedule - FRIDAY, 00:00. Add this job as a second predecessor for JOB_C with condition SUCCESS IN LAST 24 HOURS - like
job: JOB_C
condition: d(JOB_A) & s(JOB_D, 24.00)
...
Job B
Condition s(Job A, 9.00)
Start time: 9:15
Job A has run within 9 hours. Sometimes the Job A starts running again just before the scheduled start time of Job B (9:15). Because of this, Job B cannot start as Job A is RU instead of SU.
What kind of condition on Job B would solve this issue?
Is your jobB should be really dependent with the success of jobA? if yes, then all you need to do is to wait for the jobA to be completed, and jobB will automatically start after that. If no, you can simply remove the jobA in the run condition of jobB and remain the start time of jobB as 9:15. Also, are your jobs reside in the same box? Is your jobA has multiple run time in a day?
I have a box which has its own start time and starting conditions on other boxes. Say the box has a start time of 5:30 and has condition like s(a, 30)&s(b, 22)&s(c)
What will happen at 5:30 if all the conditions are not met?
Will the box trigger ever, when the conditions are met even after 5:30?
Box will stay INACTIVE until ALL the conditions (no matter date or starting) become true.
So at 5:30 it will be still INACTIVE if any of conditions is not met.
And yes, box will trigger when the conditions are met even after 5:30.
It looks like the jobs A and B have look back times set on them (that's the part after the name of the job and the comma), this will alter the behavior as outlined by the previous answer.
At 5:30a the box will kick off only if job A has reached success state within the previous 30 minutes and job B has reached success within the last 22 minutes. C must also be in success but with no specific look back interval.
If 5:30a comes around and job A went into success at 4:45a (more than 30 mins earlier) the box will not kick off. Same with job B at 22 minutes. If 5:30a comes around and job A and C are in success with job B still running (or in success from 22+ minutes earlier) the box will not kick off. If 6:01a comes around and job B goes into success the box will not run because the last success of A was 30+ minutes prior.
I hope this makes sense. I should add that I usually recommend against using a specific lookback time in favor of using a 0 lookback. This translates roughly as 'since the last time that I was used to kick you off'... But that being said, there are definitely cases where a specific lookback is appropriate. Without more information it's hard to determine if that is true in your case.
Box will stay INACTIVE until ALL off the conditions met.
So at 5:30 it will be still INACTIVE if any of conditions is not met.
And yes, box will trigger when the conditions are met even after 5:30.
And all job in Box will be in INACTIVE state, if job is independent to box and it met all conditions then this job be in running state.
if we specify start_time as well as conditions in autosys job, which get preference over another ??
For e.g. lets say start time for my job A is 06:00 AM but this job is also dependent on another job B (via conditions param) . But Job B gets becomes successful at 06:30 AM.
So my job will start running at 06:00 AM or 06:30 AM ?
My guess is start time as well as conditions, both will be considered while running the job. So job should start at 06:30 AM. But i still want to be sure.
-Gaurav
Start_time:- Job started means Activated or might be run, (if conditions are already met) at starting time.
Conditions:- Means job would run after given condition mate.
Example:-
Suppose job A starting time is 11:00 PM and its condition is s(B)---->B should success, B is another job that would complete at 11:30 PM. In this scenario A started at 11:00 PM but it would in active state for 30 min. than it would in running state.
Your job will be in Activated state at 6:00 AM and will wait until B completes...but
consider a situation when you have another job C which is running before B. In case if C is running long and B is delayed and is not in Activated state (it is in sucessfull since run from, say, yesterday and waiting for C), you job A will also trigger as it's already 6 and B is in success (even from yesterday).
In order to avoid this, you have two ways:
1) Make B activated before A
2) Make a condition s(A, )