Skip to content

Add support for activity reset #2546

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

Add support for activity reset

closes #2488

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner June 4, 2025 22:23
Copy link
Member

Choose a reason for hiding this comment

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

With some other SDKs, we have also provided a way to activities to see all states that may affect cancellation even though only one is thrown. We call it "cancellation details". I wonder if we should provide something like that in Java on the activity context (so they can see bools for cancel requested, paused, reset, etc).

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, we should there is a separate issue for this

Copy link
Contributor

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

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

left some thoughts on priority/ordering between pause and reset

Comment on lines +191 to +194
} else if (status.getActivityPaused()) {
throw new ActivityPausedException();
} else if (status.getActivityReset()) {
throw new ActivityResetException();
Copy link
Contributor

@THardy98 THardy98 Jun 18, 2025

Choose a reason for hiding this comment

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

I think the ordering here matters.
What happens if a client issues a pause and a reset before the next heartbeat?

In principle, I think we would want to give precedence to reset. Reset > pause would be consistent with the priority/ordering in core as well

Comment on lines +208 to +211
} else if (status.getActivityPaused()) {
throw new ActivityPausedException();
} else if (status.getActivityReset()) {
throw new ActivityResetException();
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Comment on lines +231 to +232
} else if (status.getActivityReset()) {
lastException = new ActivityResetException(info);
Copy link
Contributor

Choose a reason for hiding this comment

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

here as well

Comment on lines +33 to +34
// assumeTrue(
// "Test Server doesn't support activity pause", SDKTestWorkflowRule.useExternalService);
Copy link
Contributor

Choose a reason for hiding this comment

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

old comment?

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.

[java] SDK support for activity reset
3 participants