Allow a timer summary on Workflow.sleep and Workflow.await with timeout
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- java
- Domínio
- api, backend, distributed-systems
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Java
- Estrelas
- 441
- Forks
- 266
- Merge médio
- 5d 3h
- PRs com merge (30d)
- 19
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de temporalio/sdk-java
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
temporalio/sdk-java#1825 ·
Mantenedores costumam responder em até 2 dias
-
Skipped mutableSideEffect leaks an empty RecordMarker command after a full replay, and the workflow task fails on every retryTalvez já em andamento @Quinn-With-Two-Ns assumiu há 12 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
temporalio/sdk-java#3163 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Add Spring Boot auto-configuration for standalone ActivityClientTalvez já em andamento @Quinn-With-Two-Ns assumiu há 12 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
temporalio/sdk-java#3146 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdownTalvez já em andamento @eamsden assumiu há 27 dias. Aberta
temporalio/sdk-java#3135 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Skip result deserialization for local activities and SideEffect when not replaying (mutableSideEffect already does this)Talvez já em andamento @Quinn-With-Two-Ns assumiu há 22 dias. Abertaenhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 54/100
temporalio/sdk-java#3125 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 2 dias
Todas as issues de temporalio/sdk-java
Issues semelhantes
-
maintenance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
apache/maven-resources-plugin#569 ·
Mantenedores costumam responder em até 1 dia
-
Data Sources visit drilldown returns an empty visitDurationByType for Achilles 1.7+ results (query still reads analysis 211)Talvez já em andamento @DG47 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
BUG
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
camel-tooling/camel-language-server#1482 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
micronaut-projects/micronaut-redis#844 ·
Mantenedores costumam responder em até 4 dias