temporalio / temporalio/sdk-python

[Feature Request] Handle edge case of recursive exceptions in failure converter

Open
#697 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.2k
Forks
241
Avg merge
3d 21h
Merged PRs (30d)
55

Description

Is your feature request related to a problem? Please describe.

It is kind of an easy mistake to do in python:

try:
    raise ValueError("test")
except Exception as e:
    raise e from e

The re-raised exception will have e.__cause__ referencing itself resulting in failure to serialize error and python sdk won't report anything resulting in retries and startToClose timeouts.

Describe the solution you'd like

Handle a case when e.__cause__ == e in DefaultFailureConverter. Created a dummy pull request #696

Additional context

https://temporalio.slack.com/archives/CTT84RS0P/p1719632201314119

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DefaultFailureConverter and review the recursive exception example in the issue, then inspect dummy pull request #696 for the proposed scope. Done means the self-referential cause case no longer fails to serialize and the Python SDK can report it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.