Work inside the handler invocations and Context.run() calls is not interrupted when invocations are aborted
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
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Bắt đầu bằng cách so sánh triển khai Kotlin HandlerRunner với cách Java HandlerRunner xử lý onClosedInvocationStreamHook. Theo dõi đường đi của executor vào ContextImpl và các lệnh gọi Context.run(), sau đó xác minh rằng công việc đang chạy trong các handler bị ngắt sau khi một invocation stream bị đóng do abort. Issue không nêu các tệp hoặc bài kiểm thử cụ thể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey there. I was testing restate sdk using java and noticed that work inside the handlers was still being performed long after restate server aborted the invocations (abort timeout reached). I noticed that HandlerRunner for kotlin has an implementation that cancels work using onClosedInvocationStreamHook, but java implementation for HandlerRunner ignores onClosedInvocationStreamHook. Is this intentional?
If not, 2 solutions come to mind:
- Keep a collection of threads which are doing work by registering thread's reference inside the executor calls:
**initialize worker thread references collection here**
**set onClosedInvocationStreamHook to iterate over the worker threads and interrupt them here**
options.executor.execute(
() -> {
HANDLER_CONTEXT_THREAD_LOCAL.set(handlerContext);
try (Scope ignored =
handlerContext.request().openTelemetryContext().makeCurrent()) {
**add thread's ref to collection here**
runnable.run();
} finally {
**remove thread's ref from collection here**
HANDLER_CONTEXT_THREAD_LOCAL.remove();
}
});
- Require ExecutorService instead of Executor when setting up the handler options, so that ExecutorService.submit(...) method is used instead of Executor.execute(...) and the output Futures can be collected and used to interrupt the worker threads when onClosedInvocationStreamHook is called (Future has cancel method which can interrupt thread). However, I see that Executor is passed down to ContextImpl so this change could propagate beyond HandlerRunner's scope. Maybe an adapter between ExecutorService and Executor can be made to limit the scope (ExecutorService wrapped by Executor which is passed into ContextImpl, when Executor.execute is called, the call is delegated to ExecutorService.submit and the resulting Futures are collected inside HandlerRunner)
- Ngôn ngữ chính
- Java
- Star
- 60
- Fork
- 17
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 restatedev/sdk-java
-
Vert.x 5 update Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
restatedev/sdk-java#629 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
restatedev/sdk-java#614 · 2 bình luận ·
-
Reflection based experience Đang mở
restatedev/sdk-java#570 · 1 người được giao ·
-
Java jackson 3 version upgrade Đang mởdependencies
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
restatedev/sdk-java#569 · 2 bình luận · 1 reaction ·
-
Spring boot Servlet integration Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
restatedev/sdk-java#555 · 1 bình luận ·
Tất cả issue của restatedev/sdk-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·