[Bug] Nondeterminism replaying local activity markers recorded after a FORCE_CLOSE_COMMAND workflow task failure (1.34.0)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 8/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- distributed-systems
Direção de pesquisa
The failure is a replay nondeterminism error, Missing associated machine for LocalActivity(1719), raised when Replayer reprocesses the downloaded history. Start by reproducing it from the sanitized marker metadata, then check how local activity results are ordered within an activation after a FORCE_CLOSE_COMMAND task failure. Done means a replay of that history succeeds without the error. This needs deep knowledge of the workflow state machine and the Rust core, so it is not a first contribution.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What are you really trying to do?
A workflow fans out ~900 regular activities with asyncio.gather. A workflow outbound interceptor records progress with a local activity: at most one is in flight, and when it resolves a done callback starts the next one with the changes accumulated in the meantime. (We have replaced it with a regular activity as a workaround.)
Describe the bug
While results streamed in, workflow tasks took 2.5-6 s and the server failed them 12 times with WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND (51-139 activity completions arrived during each task). After one of those, the next workflow task (started 08:52:05.021Z, completed 08:52:08.319Z) recorded, in this order:
- local activity marker seq 1296 (
activation_index1,original_schedule_time08:52:04.597Z,complete_time08:52:00.700Z) - 422 x ScheduleActivityTask (seq 1297-1718)
- local activity marker seq 1719 (
activation_index1,original_schedule_time08:52:04.637Z,complete_time08:52:02.229Z) - 49 x ScheduleActivityTask
- local activity markers seq 1769 (
activation_index2) and 1770 (activation_index3)
The complete_time of 1296 and 1719 is before that task started, so both ran during the force-closed attempt (08:52:00.674Z-08:52:04.941Z) and their results were handed to the next attempt.
Any later full replay of this history fails with:
[TMPRL1100] Nondeterminism error: Missing associated machine for LocalActivity(1719)
Replaying the downloaded history with Replayer, the same workflow code and temporalio 1.34.0 fails the same way, so the SDK cannot replay a history it wrote. On the live worker the workflow task kept failing until we terminated the workflow (114 attempts over 16 hours).
Our reading (may be wrong): in the original activation 1, the 1296 result was delivered after the 422 activity resolutions, so the next local activity got seq 1719. activation_index keeps 1296 in activation 1 but not its position among the other resolutions in that activation, so on replay the next local activity gets a different seq.
Minimal Reproduction
We don't have a minimal reproduction yet. The history contains customer data, so we can't attach it, but we can share sanitized event and marker metadata or run a patched build against it.
Shape: asyncio.gather over many activities, plus an outbound interceptor that chains one local activity at a time from done callbacks, plus enough concurrent completions to trigger FORCE_CLOSE_COMMAND (default history.maximumBufferedEventsBatch = 100).
Environment/Versions
- temporalio (Python) 1.34.0, which includes "Record order LAs are resolved in WFTs" (temporalio/sdk-rust#1616); Python 3.12; Linux container
- Temporal server 1.31.1, default dynamic config
- Related: #1881 (closed), #1578 (open)
Additional context
Workaround: send the recording call as a regular activity instead of a local activity.
- Linguagem predominante
- Python
- Estrelas
- 1.2k
- Forks
- 269
- Merge médio
- 1d 21h
- PRs com merge (30d)
- 56
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-python
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
temporalio/sdk-python#496 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
temporalio/sdk-python#1988 ·
Mantenedores costumam responder em até 1 dia
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdownTalvez já em andamento @eamsden assumiu há 11 dias. Aberta
temporalio/sdk-python#1948 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Cloud CI Skips Nexus TestsTalvez livre de novo @tconley1428 assumiu há 70 dias e não há nenhum pull request aberto. Aberta
temporalio/sdk-python#1704 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Windows ARM64 wheel supportAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
temporalio/sdk-python#1592 · 8 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de temporalio/sdk-python
Issues semelhantes
-
idxmax/idxmin raise ValueError when a single partition is all-NATalvez já em andamento @Jason10191019999 assumiu hoje. Abertaneeds triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 3 dias
-
Old versions of datamodelsAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
-
[BUG]: Windows GUI package of v1.17.0-rc3 has no GTK DLLsTalvez já em andamento @andrut-ds assumiu hoje. Abertabug CI/CD Pactus-GUI Windows
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
pactus-project/pactus#2428 ·
Mantenedores costumam responder em até 1 dia
-
DiskDataset.reshard() can hang with a zero or negative shard sizeTalvez já em andamento @Programmer-Develops assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 19 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
GNS3/gns3-server#3017 · 1 comentário ·
Mantenedores costumam responder em até 1 dia