Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SWF] POJOActivityImplementation should not try to serialize arbitrary exceptions #5

Open
manikandanrs opened this issue Aug 3, 2016 · 0 comments
Labels

Comments

@manikandanrs
Copy link
Contributor

From @christophercurrie on February 26, 2015 4:30

When an exception is thrown in an Activity implementation, POJOActivityImplementation attempts to serialize the exception using the current DataConverter. If this fails, however, it throws ActivityFailureException, for which there is no catch block to handle. This results in the exception being logged, but not returned to the Workflow, and the activity ultimately times out.

The reason this is an issue is that exceptions aren't always made to be serialized. As an example, StatementException in the JDBI package provides an accessor to the JDBC connection that triggered the exception; this connection contains a circular reference, which causes the default Jackson serializer used by JsonDataConverter to eventually throw a StackOverflowError.

To fix this, POJOActivityImplementation should only serialize exceptions that it knows will serialize safely, and should instead extract the message (and possibly the stack trace) from any unknown errors that it encounters to be serialized some other way. Otherwise, end users have to defend against this behavior by catching and wrapping problematic exceptions within Activity code, or otherwise live with Activity timeouts.

Copied from original issue: aws/aws-sdk-java#364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant