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

Offen
#641 3 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Python
Sterne
1.2k
Forks
241
Ø Merge
3 T. 21 Std.
Gemergte PRs (30 T.)
55

Beschreibung

What are you really trying to do?

List workflow queries using the UI (Queries tab)

image
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=FailureConverterWithDecodedAttributes to 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"

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit DefaultFailureConverter und dem im Reproduktionsfall des Verschlüsselungsbeispiels beschriebenen Client-Workflow-Handle-Abfragepfad, wobei der Fokus auf failure_converter_class und encode_common_attributes=True liegt. Führe das Beispiel für eine nicht vorhandene Abfrage erneut aus und verifiziere, dass eine nicht registrierte Abfrage ihren zugrunde liegenden Fehler meldet statt "Encoded failure".

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.