0

I know Until activity works as do...until. So it doesn't check expression for first run and when 2nd execution for inner activity comes it first check the expression. If expression results true then it will execute inner activity and so on...

But the situation is not same when I tried, it only repeat when expression results false. Here @equals(1,2) runs inner activity but if I put @equals(1,1) it execute inner activities only once. enter image description here

In my situation, I need to recall inner activities till specific activity(notebook) failed. @equals('Failed',string(activity('CheckStatus').Status)) So, here it should recall inner activities from 2nd time as above condition is true, but it wont react in such way. As you can see in below screenshot, it run only for first time. enter image description here

Update for more specific scenario as per comments in one of the answer.

  1. I want to loop on failure for specific number of time in case of failure so the expression I put is @and(equals('Failed',activity('CheckStatus').Status),lessOrEquals(int(variables('counter')),3)). So it says that If CheckStatus activity failed AND counter <= 3, if this condition true call inner activity again. enter image description here
  2. Inner activity is setting that counter and call my CheckStatus notebook, if failed wait for 5 minute. enter image description here
Manish Jain
  • 217
  • 1
  • 4
  • 16

1 Answers1

0

Correct. The Until activity loops once then continues to loop until the expression returns true. Typically you have it check some output of an activity in the loop. For example you could loop until an activity that checks the status of a long running operation returns true:

@equals('Succeeded',string(activity('CheckStatus').output.properties.state))

In your case you should just copy the Databricks activity to the top level of the pipeline and remove the Until activity. Then set Retry=3 and RetryInterval=300 on the Databricks activity. It will allow up to 3 retries with a 5 minute pause between retries. If all retries fail it will fail the pipeline.

GregGalloway
  • 11,355
  • 3
  • 16
  • 47
  • yes, I tried and updated in question here. Can you please direct me for the bug here. – Manish Jain Jun 15 '21 at 13:29
  • @ManishJain instead of .Status try .output.Status (but you will have to click on the output of that activity in the monitoring pane to confirm Status is the top of the output) – GregGalloway Jun 15 '21 at 15:43
  • @ManishJain oh sorry! I thought you were expecting the activity to succeed and check the output. Are you expecting the activity inside the loop to fail? How do you expect to handle? Retry a certain number of times? Fail the loop? – GregGalloway Jun 16 '21 at 00:05
  • Yes, you are right. I want to retry(3 time) inner activities with 5 minute interval, in case of specific inner activity failure. I update exact scenario to question. – Manish Jain Jun 16 '21 at 04:17
  • @ManishJain why do you need the Until loop at all? Can’t you just move those activities in the loop up to the top level and set Retry=3 and RetryInterval=300 on each of the activities? I assume if the second activity fails it doesn’t need to rerun the first activity again – GregGalloway Jun 16 '21 at 14:32
  • Thanks for your time here, actually that is not the thing-how I designed. The thing is why it doesn't go in-when expression is true in until loop :-) – Manish Jain Jun 16 '21 at 16:50
  • @ManishJain I don’t understand what you are saying – GregGalloway Jun 16 '21 at 16:55
  • `@equals('Failed',string(activity('CheckStatus').Status))` is going to be true when Until come to check for 2nd run. At that time, this condition returns true but even though inner activities are not running. – Manish Jain Jun 17 '21 at 04:44
  • Thanks, I knew those properties in ADB-Notebook activity. Actual intention about the question is Until must go in when expression is 'True' but it is not. Add-up is `@activity('CheckStatus').Status)` value is *Failed* when it failed so expression is perfectly accurate. – Manish Jain Jun 17 '21 at 06:28