Allow a timer summary on Workflow.sleep and Workflow.await with timeout
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- api, backend, distributed-systems
Línea de trabajo
Start with SyncWorkflowContext.java:1368-1401 and trace the Workflow sleep/await APIs into WorkflowOutboundCallsInterceptor, its Base, and TracingWorkerInterceptor. Add the proposed TimerOptions overloads while preserving both CANCEL_AWAIT_TIMER_ON_CONDITION branches, then verify replay compatibility with an old history that has no timer summary.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
Workflow.newTimer(Duration, TimerOptions) can set a summary, but Workflow.sleep(Duration) and Workflow.await(Duration, Supplier) create their timers with default options (SyncWorkflowContext.java:1368-1401). I'd like sleep and timed await to accept TimerOptions, so a workflow waiting on a human approval with a timeout can label that timer. Today the workaround for sleep is Workflow.newTimer(d, options).get(). For a timed await you have to race the condition against your own timer and cancel it yourself, which is what await already does internally. temporalio/features#669 tracks this across SDKs.
Describe the solution you'd like
// Workflow
public static void sleep(Duration duration, TimerOptions options);
public static boolean await(Duration timeout, TimerOptions options, Supplier<Boolean> unblockCondition);
// WorkflowOutboundCallsInterceptor (+ Base)
void sleep(Duration duration, TimerOptions options);
boolean await(Duration timeout, TimerOptions options, String reason, Supplier<Boolean> unblockCondition);
This follows #2218, which added newTimer(Duration, TimerOptions) to the interceptor, its Base, and TracingWorkerInterceptor. The interface is @Experimental, but direct implementers still get a source change. Replay checks the timer command type and ID, not its user metadata, so I don't expect this to need a new SDK flag. I haven't verified that against a replay yet. Both await branches under CANCEL_AWAIT_TIMER_ON_CONDITION (enabled in #3099) would keep their behavior.
Other SDKs: Python has workflow.sleep(..., summary=) and workflow.wait_condition(..., timeout_summary=). Go has workflow.AwaitWithOptions with AwaitOptions{Timeout, TimerOptions}. PHP added AwaitOptions to Workflow::awaitWithTimeout() in temporalio/sdk-php#805.
Describe alternatives you've considered
An AwaitOptions class like Go and PHP. It leaves room for more await settings but adds a type for one field today.
Additional context
This doesn't cover sleep(long, ...) or timed Promise.get, which also goes through await. I'd like to implement it, with a replay test against an old history that has no summary. I'll go with the TimerOptions overloads unless you'd rather have AwaitOptions.
- Lenguaje dominante
- Java
- Estrellas
- 433
- Forks
- 257
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 temporalio/sdk-java
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
temporalio/sdk-java#1825 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
temporalio/sdk-java#3125 ·
Los mantenedores suelen responder en 2 días
-
enhancement
temporalio/sdk-java#3124 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
temporalio/sdk-java#3122 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
temporalio/sdk-java#3121 ·
Los mantenedores suelen responder en 2 días
Todos los issues de temporalio/sdk-java
Issues similares
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
helidon-io/helidon#12721 ·
Los mantenedores suelen responder en 1 día
-
Upgrade to Spring RESTDocs 4.0.2Abiertostatus: team-only type: dependency-upgrade
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
spring-projects/spring-boot#51966 ·
Los mantenedores suelen responder en 1 día
-
Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
software-mansion/react-native-reanimated#10816 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Broken link in Operator GuideAbiertoarea/docs backport/26.6 backport/26.8 kind/bug status/triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
[destination-snowflake] Custom domains rejected unlike source connectionsPosiblemente ocupada @kuza55 la tomó hoy. Abiertoautoteam community connectors/destination/snowflake team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día