[Bug] `workflow.wait` broken with `asyncio.FIRST_COMPLETED` and local activities
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia con la riproduzione minima collegata e con la gestione di workflow.wait del Python SDK per le attività locali, confrontandola con quella delle attività non locali. Riproduci il caso FIRST_COMPLETED usando i comandi e i timestamp riportati, quindi verifica che l'attesa restituisca il controllo quando termina la prima attività locale e che le attività rimanenti possano essere annullate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 241
- Merge medio
- 3g 2h
- PR unite (30g)
- 49
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di temporalio/sdk-python
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
temporalio/sdk-python#1517 · 10 commenti ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
temporalio/sdk-python#496 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
temporalio/sdk-python#1890 ·
-
[Bug] Local activity resolutions regrouped on replay since 1.32.0, delivering the wrong payload Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
temporalio/sdk-python#1881 · 1 commento ·
-
bug
temporalio/sdk-python#1817 · 1 commento · 1 assegnatario ·
Tutte le issue di temporalio/sdk-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
use-agent-os/agent-os#3314 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BasedHardware/omi#15662 · 1 commento ·
-
documentation help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
AiursoftWeb/AnduinOS-2#19 ·