Skip to content

Conversation

shijiesheng
Copy link
Member

What changed?

Default data converter would throw I/O exception and thus fail workflow processing if the exception no longer exists. This PR changes the behavior by return null instead.

Why?

In V4, thrift exceptions will be removed and thus this is needed to avoid breaking existing workflows.

How did you test it?

Unit Test

Potential risks

Release notes

Documentation Changes

classType = Class.forName(className);
} catch (ClassNotFoundException e) {
throw new IOException("Cannot deserialize " + className + " exception", e);
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than returning null we should return some generic Exception type (indicating that we couldn't deserialize it) or try and deserialize the Exception as some type that we know.

For example, we could introduce an ApplicationFailureException, set classType = ApplicationFailureException.class, and deserialize the json object into that.

… converter

Signed-off-by: Shijie Sheng <liouvetren@gmail.com>
…ack on this exception instead

Signed-off-by: Shijie Sheng <liouvetren@gmail.com>
@shijiesheng shijiesheng force-pushed the data-converter-not-found-exception branch from 87f15a1 to 700479d Compare October 2, 2025 00:03
classType = Class.forName(className);
} catch (ClassNotFoundException e) {
throw new IOException("Cannot deserialize " + className + " exception", e);
return (T) new ApplicationFailureException("Class not found: " + className);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing classType = ApplicationFailureException.class is more useful to the user. They'll still get their original stacktrace and everything, just with a different type of exception.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Signed-off-by: Shijie Sheng <liouvetren@gmail.com>
@shijiesheng shijiesheng force-pushed the data-converter-not-found-exception branch from 01dbd13 to 0705365 Compare October 2, 2025 21:47
@shijiesheng shijiesheng merged commit 8f860b9 into cadence-workflow:master Oct 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants