uber / cadence-java-client

Java framework for Cadence Workflow Service
https://cadenceworkflow.io
Other
143 stars 106 forks source link

Change Java client to fail a decision instead of an API call for all argument checks #232

Open mfateev opened 5 years ago

mfateev commented 5 years ago

Currently specifying the wrong parameters to scheduling activity or a child workflow causes an exception that is thrown to a workflow code. While it sounds reasonable a bad code change might cause failures of workflows that might be running for a long time. The solution is to not to throw an application level exception, but an Error which leads to a decision failure. When decisions keep failing the workflows get stuck until the bug is fixed. This way a bad deployment is going to block workflow executions instead of failing them.

mfateev commented 5 years ago

Also move most of the validation logic to the server. The server is going to return decision eventId that failed the validation then client can use it to produce the correct stack trace.