temporalio / temporalio/sdk-python
[Bug] Sending a query that is not registered in the workflow results in an "Encoded failure" when encode_common_attributes=True
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 241
- Merge medio
- 3g 21h
- PR unite (30g)
- 55
Descrizione
What are you really trying to do?
List workflow queries using the UI (Queries tab)
Describe the bug
The UI shows "Encoded failure" but this is an error thrown by the worker when the UI tries to get the list of queries the workflow exposes with queryType: "@@temporal-internal__list
I get the same error when I use the client to send a query that is not registered in the workflow, and the client configuration has the data_converter which failure_converter_class has encode_common_attributes=True
Minimal Reproduction
Full reproduction is here https://github.com/antmendoza/my-temporal-pocs/tree/main/python/_8156
clone https://github.com/temporalio/samples-python/tree/main/encryption
Add the following modifications:
- Create a new DefaultFailureConverter with encode_common_attributes=True
class FailureConverterWithDecodedAttributes(temporalio.DefaultFailureConverter):
def __init__(self) -> None:
super().__init__(encode_common_attributes=True)
- Add
failure_converter_class=FailureConverterWithDecodedAttributesto the client.
client = await Client.connect(
"localhost:7233",
# Use the default converter, but change the codec
data_converter=dataclasses.replace(
temporalio.converter.default(),
payload_codec=EncryptionCodec(),
failure_converter_class=FailureConverterWithDecodedAttributes,
),
)
After running a workflow, try to send a query that does not exist for the workflow.
await client.get_workflow_handle("encryption-workflow-id").query("non-existing-query")
The query will fail with "Encoded failure"
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.
Direzione di ricerca
Inizia con DefaultFailureConverter e il percorso della query workflow-handle del client descritto nella riproduzione dell’esempio di crittografia, concentrandoti su failure_converter_class e encode_common_attributes=True. Esegui nuovamente l’esempio di query inesistente e verifica che una query non registrata segnali l’errore sottostante anziché "Encoded failure".
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100