Fix exception type when use RetriableTask in Fan in/out pattern#174
Merged
Fix exception type when use RetriableTask in Fan in/out pattern#174
Conversation
4 tasks
davidmrdavid
approved these changes
Oct 20, 2023
Comment on lines
+1277
to
+1278
| } catch (OrchestratorBlockedException | ContinueAsNewInterruption exception) { | ||
| throw exception; |
Member
There was a problem hiding this comment.
just to confirm: can processNextEvent actually lead to a ContinueAsNewInterruption? My understanding is that processNextEvent just iterates through the history, and I would expect that ContinueAsNewInterruption would only occur when the customer code is actually invoked.
Member
Author
There was a problem hiding this comment.
Yes, ContinueAsNewInterruption would only occur when the customer code is actually invoked. The SDK code will never cause a ContinueAsNewInterruption. But when we iterate the history, if the customer code is throwing ContinueAsNewInterruption, we will let it go at this place instead of catching it.
Comment on lines
1280
to
1288
| // ignore | ||
| /** | ||
| * the idea is that for any exception thrown here it should be handled | ||
| * in the do-while loop, the same exception should also be obtained when calling | ||
| * {code#future.get()} in the do-while loop, and it will be handled correctly | ||
| * in the catch block in the do-while loop. | ||
| */ | ||
| } | ||
| // Any exception happen we return true so that we will enter to the do-while block for the last time. |
Member
There was a problem hiding this comment.
some nits on phrasing:
Suggested change
| // ignore | |
| /** | |
| * the idea is that for any exception thrown here it should be handled | |
| * in the do-while loop, the same exception should also be obtained when calling | |
| * {code#future.get()} in the do-while loop, and it will be handled correctly | |
| * in the catch block in the do-while loop. | |
| */ | |
| } | |
| // Any exception happen we return true so that we will enter to the do-while block for the last time. | |
| /** | |
| * We ignore the exception. Any Durable Task exceptions thrown here can be obtained when calling | |
| * {code#future.get()} in the implementation of 'await'. We defer to that loop to handle the exception. | |
| */ | |
| } | |
| // On an exception, we return true to the do-while block one last time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
Resolve #169
This PR fixes the exception type for using
RetriableTaskinallOfmethod.Description of the issue:
For
RetriableTaskinallOfmethod if the task failed for exception,CompositeTaskFailedExceptionis not thrown out instead it's aTaskFailedExceptionbeing thrown out. The reason is that theCompositeTaskFailedExceptionthat built in exceptionPath haven't get chance to be obtained at future.get(), ContextImplTask.this.processNextEvent() will first threw aTaskFailedExceptionFor example:
This PR update the
do-whileblock logics so that all exception will be handle inside the blockdurabletask-java/client/src/main/java/com/microsoft/durabletask/TaskOrchestrationExecutor.java
Line 1264 in e938278
Pull request checklist
CHANGELOG.mdAdditional information
Additional PR information