[Bug] `workflow.wait` broken with `asyncio.FIRST_COMPLETED` and local activities
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza con la reproducción mínima enlazada y el manejo de workflow.wait de Python SDK para actividades locales, comparándolo con actividades no locales. Reproduce el caso FIRST_COMPLETED usando los comandos y las marcas de tiempo indicados, y verifica después que la espera retorna cuando finaliza la primera actividad local y que las actividades restantes se pueden cancelar.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What are you really trying to do?
Start N local activities, wait for the first one to finish, cancel the others.
Describe the bug
If I start N local activities, then use workflow.wait(tasks, return_when=asyncio.FIRST_COMPLETED), the workflow.wait coro blocks until all of the activities actually finish, instead of returning when the first one finishes. If I use non-local activities, this bug does not happen.
Minimal Reproduction
https://github.com/andmis/snippets/tree/temporal-python-sdk-local-activity-workflow-wait-bug
# Worker output after `python run_workflow.py`
2024-12-09 19:02:30.750775+00:00 (Workflow) Starting, local=False
2024-12-09 19:02:30.750775+00:00 (Workflow) Waiting for first completed activity
2024-12-09 11:02:30.760073 (Activity 0) Running sandbox_activity
2024-12-09 11:02:30.760565 (Activity 1) Running sandbox_activity
2024-12-09 11:02:32.875597 (Activity 1) Exiting sandbox_activity
2024-12-09 19:02:32.891753+00:00 (Workflow) Got first completed activity, cancelling others and exiting
2024-12-09 19:02:32.891753+00:00 (Workflow) Exiting
2024-12-09 11:02:35.328912 (Activity 0) Cancelling sandbox_activity
# Worker output after `python run_workflow.py -l`
2024-12-09 19:03:48.421271+00:00 (Workflow) Starting, local=True
2024-12-09 19:03:48.421271+00:00 (Workflow) Waiting for first completed activity
2024-12-09 11:03:48.425911 (Activity 0) Running sandbox_activity
2024-12-09 11:03:48.426165 (Activity 1) Running sandbox_activity
2024-12-09 11:03:49.817020 (Activity 1) Exiting sandbox_activity
2024-12-09 11:03:56.397142 (Activity 0) Exiting sandbox_activity
2024-12-09 19:03:56.394210+00:00 (Workflow) Got first completed activity, cancelling others and exiting
2024-12-09 19:03:56.394210+00:00 (Workflow) Exiting
# Note the timestamps
Environment/Versions
- OS and processor: macOS, M1
- Temporal version: 1.1.2
- Python SDK version: 1.8.0
- Are you using Docker or Kubernetes or building Temporal from source? No
Additional context
- Lenguaje dominante
- Python
- Estrellas
- 1.2k
- Forks
- 241
- Merge medio
- 3 d 2 h
- PR fusionados (30 d)
- 49
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-python
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
temporalio/sdk-python#1517 · 10 comentarios ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
temporalio/sdk-python#496 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
temporalio/sdk-python#1890 ·
-
[Bug] Local activity resolutions regrouped on replay since 1.32.0, delivering the wrong payload Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
temporalio/sdk-python#1881 · 1 comentario ·
-
bug
temporalio/sdk-python#1817 · 1 comentario · 1 asignado ·
Todos los issues de temporalio/sdk-python
Issues similares
-
triage/confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
apache/cloudstack#14222 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100