Azure-docs: Execute Pipeline Activity The final execution status of the pipeline BUG

Created on 3 Jan 2020  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

Hi team,
I moved this from here: https://github.com/MicrosoftDocs/azure-docs.zh-cn/issues/678

The comments below were machine-translated

@Mr-San commented 11 hours ago — with docs.microsoft.com
Normal logic: Set variable Activity (B)-> Hive Activity (A), the dependency condition of activity B for activity A is "failure", after A fails, call B successfully, then Pipeline returns success

Found BUG: Set variable Activity (B)-> Execute Pipeline Activity (A), the dependency condition of activity B for activity A is "failure", after A fails, call B successfully, but Pipeline returns failure?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 awaiting-product-team-response cxp data-factorsvc product-question triaged

Most helpful comment

So for what you want, @Mr-San , you can try this:
image
If an activity is not run, that means it is _skipped_ . The skipped dependency means "run the next activity only if the current activity was not run." A completion dependency is fulfilled by both success or failure. A completion dependency is the opposite of a skipped dependency.
In the above, when "Run HQL" fails, stored procedure "Run Failed" is executed then the Set Variable and Hive are executed. Even though "Run success" is connected to "Run HQL" by a completion dependancy, it does not run because the skipped dependancy is not fulfilled because "Run Failed" _does_ run.
When "Run HQL" succeeds, stored procedure "Run Success" is run because the completion dependency is fulfilled, and the skipped dependency is fulfilled because "Run Failed" does not run.

If you have more questions, please let me know and I will reopen the issue.

All 9 comments

Thanks for the feedback and bringing this to our notice . At this time we are reviewing the feedback and will update the document as appropriate .

@CeciAc @Mr-San Is this what you are seeing?
image
Are there any other activities failing?
image

I need more information to reproduce or troubleshoot your situation.
Can you share pipeline definition or pipeline run ID

Normal logic: Set variable Activity (B)-> Hive Activity (A), the dependency condition of activity B for activity A is "failure", after A fails, call B successfully, then Pipeline returns success

Found BUG: Set variable Activity (B)-> Execute Pipeline Activity (A), the dependency condition of activity B for activity A is "failure", after A fails, call B successfully, but Pipeline returns failure?

pipeline_run_bug

Thank you for bringing this to my attention. I will escalate the issue internally.

I removed my previous post because I misinformed you.

@Mr-San I have better information for you now.
The success / failure status of the pipeline depends upon what dependancies the failing activity has.
Rules:

Only have success branch after failure -> failure
Only have failure branch after failure -> success
Have nothing after failure -> failure
have both success and failure after failure -> failure

Examples:

failing activity only has a failure dependancy -> pipeline succeeds
image

failing activity only has a success dependancy -> pipeline fails
image

failing activity has both success and failure dependancies -> pipeline fails
image

failing activity has a completion dependancy -> pipeline succeeds
image

failing activity has completion and success dependancies -> pipeline fails
image

failing activity has completion and failure dependancies -> pipeline succeeds
image

failing activity has completion and success and failure dependancies -> pipeline fails
image


In your pipeline, the failing activity is "Run HQL". This activity has both success and failure dependancies. This matches the third example and the fourth rule.
However, I do have a way to re-write the logic so that parent pipeline succeeds while failing Execute Pipeline.
image

So for what you want, @Mr-San , you can try this:
image
If an activity is not run, that means it is _skipped_ . The skipped dependency means "run the next activity only if the current activity was not run." A completion dependency is fulfilled by both success or failure. A completion dependency is the opposite of a skipped dependency.
In the above, when "Run HQL" fails, stored procedure "Run Failed" is executed then the Set Variable and Hive are executed. Even though "Run success" is connected to "Run HQL" by a completion dependancy, it does not run because the skipped dependancy is not fulfilled because "Run Failed" _does_ run.
When "Run HQL" succeeds, stored procedure "Run Success" is run because the completion dependency is fulfilled, and the skipped dependency is fulfilled because "Run Failed" does not run.

If you have more questions, please let me know and I will reopen the issue.

The simple rule is:
If there is a success path, and that path is not taken, then fail the pipeline.

@MartinJaffer-MSFT , the rule appears to be even more subtle....

I think the pipeline will fail if:

  • EITHER an activity with no down-stream activities fails.
  • OR if an activity is skipped, _solely and directly_ caused by a failure in an immediately upstream activity.

I believe your last screenshot would behave identically (incl. overall success state) if the 'onCompletion' dependency is changed to an 'onSuccess' dependency, too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments