Work inside the handler invocations and Context.run() calls is not interrupted when invocations are aborted
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Área
- backend, distributed-systems
Línea de trabajo
Comienza comparando la implementación de Kotlin HandlerRunner con el manejo de onClosedInvocationStreamHook de Java HandlerRunner. Sigue el recorrido del executor hasta ContextImpl y las llamadas a Context.run(), y verifica después que el trabajo que se está ejecutando en los handlers se interrumpe cuando un invocation stream se cierra debido a un abort. El issue no especifica archivos ni tests concretos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Java
- Estrellas
- 60
- Forks
- 17
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de restatedev/sdk-java
-
Vert.x 5 update Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
restatedev/sdk-java#629 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
restatedev/sdk-java#614 · 2 comentarios ·
-
Reflection based experience Abierto
restatedev/sdk-java#570 · 1 asignado ·
-
Java jackson 3 version upgrade Abiertodependencies
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
restatedev/sdk-java#569 · 2 comentarios · 1 reacción ·
-
Spring boot Servlet integration Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
restatedev/sdk-java#555 · 1 comentario ·
Todos los issues de restatedev/sdk-java
Issues similares
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Abiertoarea/plugin
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Add canonical URLs and a sitemap Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/rocketmq-dashboard#5064 ·