Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

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

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner February 20, 2025 18:23
Comment on lines 74 to 80
} catch (OperationTokenUtil.FallbackToWorkflowIdException e) {
return operationToken;
}
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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 ?

Copy link
Member

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.

Copy link
Member

@cretz cretz Feb 20, 2025

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.

Copy link
Contributor Author

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

Copy link
Member

@cretz cretz Feb 20, 2025

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.

Copy link
Contributor Author

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

Copy link
Member

@bergundy bergundy left a 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));
Copy link
Member

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.

Copy link
Contributor Author

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

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 729e25e into temporalio:master Feb 24, 2025
8 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.

3 participants