Parent job is not failing even after Child job failure

Highlighted
Seven Stars

Parent job is not failing even after Child job failure

Hi,

We are facing an issue, Parent job is not failing even after failure of child job , Due to this our job flow is changing.

Please help us here to resolve this issue.

Talend: Talend Open Studio for Big Data 7.0.1 v

refer snapshot below,

 

1.JPG

 

2.JPG


Accepted Solutions
Community Manager

Re: Parent job is not failing even after Child job failure

This will be caused by the tPostJob. What you need to do is to track where you are getting your errors. Then track them in the main flow. When you tPostJob is triggered, after you have committed your DB work (if you still want to do that with a failure?) use a runif link to a tDie component. The logic in the runif link should be to test for an error in your job. The tDie will supply the error to the main job.

 

I notice you have another child job inside your child job. You may need to consider this as well.


All Replies
Twelve Stars

Re: Parent job is not failing even after Child job failure

it's working for me…
can you insert flow to iterate before trunjob? and try again

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Seven Stars

Re: Parent job is not failing even after Child job failure

Hi !

 

I think I've seen this case before : your job generate an error but doesn't stop because it doesn't end with an error code equals to 1.

You need generate this error code in order to make your job fail.

 

Like "Data truncation" is shown in red, but is not an error.

Like "Unwinding now" is shown in red as an exception but is not a real error.

 

To "debug", use tJava or a warn and link it with an "IF" condition. Set it to "true" (without quotes) to force it.

It will show you the return code (the one in the outline panel, in globalvar).

 

 

Sincerely,

Community Manager

Re: Parent job is not failing even after Child job failure

To add to what @rmartin said, this behaviour can be seen when you have a tPostJob in your child job. If this is the case, you need to track whether a failure has occurred and trigger a tDie in your tPostJob if an error has occurred in your main flow

Seven Stars

Re: Parent job is not failing even after Child job failure

Hi @rmartin , @rhall_2_0 ,

 

Can you elaborate your suggested solution please.

 

1. How to generate error code manually in subjob

2. Is it because of trunjob? If i remove the same, will it resolve the issue?

3. How to track issues in subjob (child) to trigger tDie.

 

 

 

Community Manager

Re: Parent job is not failing even after Child job failure

Can you share a screenshot of your child job?

Seven Stars

Re: Parent job is not failing even after Child job failure

Hi @rhall_2_0,

 

Below is the child job screenshot, (same job, different portions)

11.JPG12.JPG13.JPG

Seven Stars

Re: Parent job is not failing even after Child job failure

Hi !

 

Seeing your job, 2 things are to check/change :

  • When you detect an error, use tDie not tWarn
  • You need to check if the subjob  in the middle this job propagate their errors

If you can also add the location of your error and the type, it could help.

 

Sincerely,

Community Manager

Re: Parent job is not failing even after Child job failure

This will be caused by the tPostJob. What you need to do is to track where you are getting your errors. Then track them in the main flow. When you tPostJob is triggered, after you have committed your DB work (if you still want to do that with a failure?) use a runif link to a tDie component. The logic in the runif link should be to test for an error in your job. The tDie will supply the error to the main job.

 

I notice you have another child job inside your child job. You may need to consider this as well.

Seven Stars

Re: Parent job is not failing even after Child job failure

Hi @rhall_2_0 ,

 

I have used two tlogcatcher to capture warnings (writing into log file) and another one to capture errors (writing into a table).

capture warnings to file

14.JPG

capture errors to table

16.JPG

 

So I modified second subjob (tlogcatcher1) and connected a tDie by assuming in case any error occurred, this will write that error in a table and later it will fail. But I am getting error below, any idea on this?

Sub Job design,

15.JPG

Error getting while running this,

tDie_1 - tDie failed to log message due to internal error: java.lang.StackOverflowError
java.lang.StackOverflowError
at com.mysql.jdbc.Util.handleNewInstance(Util.java:429)
at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:382)
at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3262)

Community Manager

Re: Parent job is not failing even after Child job failure

The tDie will generate an error. So essentially you creating an endless loop of errors causing errors, causing errors, etc. That is why you get a StackOverflow error.

 

You appear to have a lot of tWarns in your job and your links (OnComonentOK and OnSibjobOK) don't all look very logical....but I do not understand the flow. Maybe something to keep an eye on.

 

Instead of the tDie there, add a tJava to assign a globalMap variable with an error indicator. Something like....

 

globalMap.put("error", true);

Then use a runif after your tPostJob component to test the value of that globalMap variable. If true, then call the tDie.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Studio Improvements for API Services

Take a look at the Talend Studio improvements for API Services

Watch Now

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now