FailureDetails.IsCausedBy throws
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start at FailureDetails.isCausedBy() and trace how the failure's error type is serialized and reconstructed when accessed through retryContext. Use the provided custom retry handler and exception scenario to reproduce the failure. Done means isCausedBy() can evaluate the cause class successfully, with coverage for the reproduced case.
Written by the indexing model from the issue text.
Description
When an activity function throws an exception, and it is caught by a custom retry handler in an orchestrator, the retryContext allows accessing the FailureDetails for analysis of the failure. However, attempting to use the FailureDetails.isCausedBy() method will never succeed, as it internally is implemented using Class.forName() which requires the fully-qualified exception class name but FailureDetails does not have this information serialized, just the simple exception class name.
Repro:
@FunctionName("CustomRetryActivityFunction")
public String customRetryActivityFunction(
@DurableOrchestrationTrigger(name = "ctx") TaskOrchestrationContext ctx) {
TaskOptions options = new TaskOptions(retryContext -> {
FailureDetails lastFailure = retryContext.getLastFailure();
if (lastFailure != null
&& lastFailure.getErrorType().equals("OverflowException")
// This line should work, but doesn't
// && lastFailure.isCausedBy(InvalidOperationException.class)
&& retryContext.getLastAttemptNumber() < 3) {
return true;
}
return false;
});
return ctx.callActivity("RaiseComplexException", ctx.getInstanceId(), options, String.class).await();
}
``
- Dominant language
- Java
- Stars
- 29
- Forks
- 18
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/durabletask-java
-
Needs: Triage :mag:
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/durabletask-java#303 ·
-
Needs: Triage :mag:
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/durabletask-java#290 · 2 comments ·
-
Needs: Triage :mag:
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/durabletask-java#285 ·
-
Needs: Triage :mag:
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/durabletask-java#276 ·
-
Enhancement
microsoft/durabletask-java#274 · 1 reaction · 2 assignees ·
All issues in microsoft/durabletask-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·