-
Notifications
You must be signed in to change notification settings - Fork 174
Workflow run token #2421
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
Workflow run token #2421
Conversation
} catch (OperationTokenUtil.FallbackToWorkflowIdException e) { | ||
return operationToken; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit confused here. so if the token is not even valid base64 or JSON we return it as the whole workflow ID? Is this for compatibility reasons? If so, is it worth maintaining pre-GA compatibility if it means swallowing every base64 or JSON failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was the agreed approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably remove this fallback in the future
Do you agree @bergundy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should remove this in the future. This is to support canceling workflow run operations that were started from older SDK versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Can we open an issue to track it? I fear this pre-GA compatibility constraint may not get removed if we don't track it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue and added a comment explaining this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I also opened a Go equivalent.
One difference here is that the linked Go SDK commit seems to treat all token parsing errors the same whereas here some are fallback and some are not. To be honest I like this one better, but if both fallbacks are temporary, then no need to change either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After temporalio/sdk-go@82c56a9 the Go and Java behaviour should be equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a couple of small comments but otherwise LGTM.
public static class OtherWorkflowImpl implements TestOtherWorkflow { | ||
@Override | ||
public String workflow(String input) { | ||
Workflow.sleep(Duration.ofSeconds(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why you had to add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so this workflow doesn't finish before the handler starting it does
temporal-sdk/src/main/java/io/temporal/nexus/WorkflowRunOperationImpl.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/nexus/WorkflowRunOperationImpl.java
Show resolved
Hide resolved
5edfbd9
to
e68bccb
Compare
Change the operation token of a start workflow run from the workflow ID to a JSON struct
see also: temporalio/sdk-go@22ebdc0#diff-0fbedb8a3b59e2b2542d81ddae097166bf3ffb124f1ee4c2837040609d779bc6