Only the innermost exception is returned when activity functions throw
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu bằng cách truy vết FailureDetails được trả về cho các lỗi của activity-function và cách retryContext.getLastFailure() cung cấp chúng. So sánh hành vi của Java SDK với các triển khai Durable bằng những ngôn ngữ khác được đề cập trong issue. Hoàn tất khi lỗi người dùng ngoài cùng, kiểu được định danh đầy đủ của lỗi đó và tất cả các lỗi bên trong lồng nhau đều có thể được kiểm tra đệ quy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implementations returning the outermost user error and all inner errors recursively.
Repro code:
@FunctionName("CustomRetryActivityFunction")
public String customRetryActivityFunction(
@DurableOrchestrationTrigger(name = "ctx") TaskOrchestrationContext ctx) {
TaskOptions options = new TaskOptions(retryContext -> {
FailureDetails lastFailure = retryContext.getLastFailure();
if (lastFailure != null
// BUG: Only the innermost failure is available in the Java SDK
// BUG: isCausedBy() relies on Class.forName() but we do not provide the fully qualified class name
// in the FailureDetails
&& lastFailure.getErrorType().equals("OverflowException")
// && lastFailure.isCausedBy(InvalidOperationException.class)
// BUG: We do not implement inner failures in the Java SDK yet
// && lastFailure.getInnerFailure() != null
// && lastFailure.getInnerFailure().isCausedBy("java.lang.OverflowException")
&& retryContext.getLastAttemptNumber() < 3) {
return true;
}
return false;
});
return ctx.callActivity("RaiseComplexException", ctx.getInstanceId(), options, String.class).await();
}
@FunctionName("RaiseComplexException")
public String raiseComplexException(
@DurableActivityTrigger(name = "instanceId") String instanceId,
final ExecutionContext context) throws InvalidOperationException {
AtomicInteger count = globalRetryCount.computeIfAbsent(instanceId, k -> new AtomicInteger(0));
int current = count.incrementAndGet();
if (current == 1) {
OverflowException inner = new OverflowException("Inner exception message");
InvalidOperationException ex = new InvalidOperationException(
"This activity failed\r\nMore information about the failure", inner);
throw ex;
} else {
return "Success";
}
}
Result:
- Ngôn ngữ chính
- Java
- Star
- 29
- Fork
- 18
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/durabletask-java
-
Needs: Triage :mag:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/durabletask-java#303 ·
-
RetryContext.lastAttemptNumber is inflated when retriable task is awaited via ctx.anyOf(...) Đang mởNeeds: Triage :mag:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
microsoft/durabletask-java#290 · 2 bình luận ·
-
Needs: Triage :mag:
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/durabletask-java#285 ·
-
Needs: Triage :mag:
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
microsoft/durabletask-java#276 ·
-
Enhancement
microsoft/durabletask-java#274 · 1 reaction · 2 người được giao ·
Tất cả issue của microsoft/durabletask-java
Issue tương tự
-
Bug Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
bug needs triage p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 bình luận ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/rocketmq-dashboard#4654 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100