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
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.2k
- Forks
- 241
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 55
Descripción
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"
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.
Línea de trabajo
Comienza con DefaultFailureConverter y la ruta de consulta del workflow-handle del cliente descrita en la reproducción del ejemplo de cifrado, centrándote en failure_converter_class y encode_common_attributes=True. Vuelve a ejecutar el ejemplo de consulta inexistente y verifica que una consulta no registrada informe de su error subyacente en lugar de "Encoded failure".
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100