Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SubJob Retry - Automatically

I have a Talend Job that fails once in a while - mostly around timeout with the tPartitioner:
 Exception in component tPartitioner_59  or sometimes java.lang.RuntimeException: Exception in tCollector_1 subjo
If I re-run the job, the job completes fine.  The job fails once in a long while... and I'm thinking - it would be great if the subjob could auto-retry.
Is there a way to configure a subjob to auto-retry (e..g auto-run) after a failure?  Could this be done through a tJava class? How?
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Put the SubJob into a child job (using a tRunJob component to incorporate it into another job) and attach that tRunJob to a tLoop that is controlled by a boolean (true for loop, false for don't loop). It will take some getting used to if you have never used a tLoop before. But if you create the boolean before the tLoop and then set it to false after the first loop has been initiated, then call the tRunJob, you can use the exit status of the tRunJob to set the boolean to true if the job fails (for try again) or keep it false if the job succeeds (for no need to run again).
Given what you have said, this should would in most cases lead to the child job being run once, but in the situation where it fails, it would keep running until it passes. You will need to make sure you keep a close eye on how you deal with values that need to be passed to the child job. I would use the globalMap hashmap to aid with ensuring your boolean value is kept up to date.