Closed SayantaBhar closed 1 year ago
Hi @SayantaBhar , your handling logic is correct, but it may be simplified as below. Thanks.
try {
// parsing
taskOrchestrationContext.allOf(parallelTasks).await();
// checking what all tasks' dependant tasks are complete
taskOrchestrationContext.createTimer(Duration.ofSeconds(5)).await();
//
} catch (OrchestratorBlockedException e) {
throw e;
} catch (Exception e) {
//logging, processing other exception.
// clean up
}
Thanks @kaibocai for confirming about the handling logic. This issue can be closed now.
(P.S: I need to do the clean up irrespective of exception thrown or not hence was doing like the way I have mentioned i.e inside finally
block.)
We are executing no. of activities after doing some parsing and resolving dependent tasks in our orchestration function. Now, in order to perform some important clean up job, all of the above logic needs to be inside a try-catch-finally block. But as per documentation: https://learn.microsoft.com/en-us/java/api/com.microsoft.durabletask.orchestratorblockedexception?view=durabletask-java-1.x
Hence, had to throw exception from finally block in case of
OrchestratorBlockedException
was thrown like the following:Otherwise was getting stuck with following exception
Do you see any issue with such kind of handling? Is there any better way to handle the above mentioned situation?