-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Drop reset_attempts and reset_heartbeat from UnpauseActivityExecution
#11393
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,10 @@ import ( | |
| type activityPauseAPI struct { | ||
| name string | ||
| pause func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity, reason, requestID string) error | ||
| unpause func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string, resetAttempts bool) error | ||
| unpause func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string) error | ||
| // unpauseResettingAttempts is nil on an API with no reset_attempts flag. Only the deprecated | ||
| // UnpauseActivity has one; UnpauseActivityExecution deliberately does not. | ||
|
Comment on lines
39
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that only one of the two APIs supports That also avoids the slightly odd shape where a subtest inside the Minor, on the comment itself:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Declined. That would cause a large diff to the WFA test, and this PR is about SAA not WFA. |
||
| unpauseResettingAttempts func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string) error | ||
| } | ||
|
|
||
| func pauseAPIs() []activityPauseAPI { | ||
|
|
@@ -55,13 +58,22 @@ func pauseAPIs() []activityPauseAPI { | |
| }) | ||
| return err | ||
| }, | ||
| unpause: func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string, resetAttempts bool) error { | ||
| unpause: func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string) error { | ||
| _, err := s.FrontendClient().UnpauseActivity(ctx, &workflowservice.UnpauseActivityRequest{ | ||
| Namespace: s.Namespace().String(), | ||
| Execution: &commonpb.WorkflowExecution{WorkflowId: wfID}, | ||
| Activity: &workflowservice.UnpauseActivityRequest_Id{Id: actID}, | ||
| Identity: identity, | ||
| }) | ||
| return err | ||
| }, | ||
| unpauseResettingAttempts: func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string) error { | ||
| _, err := s.FrontendClient().UnpauseActivity(ctx, &workflowservice.UnpauseActivityRequest{ | ||
| Namespace: s.Namespace().String(), | ||
| Execution: &commonpb.WorkflowExecution{WorkflowId: wfID}, | ||
| Activity: &workflowservice.UnpauseActivityRequest_Id{Id: actID}, | ||
| Identity: identity, | ||
| ResetAttempts: resetAttempts, | ||
| ResetAttempts: true, | ||
| }) | ||
| return err | ||
| }, | ||
|
|
@@ -79,13 +91,12 @@ func pauseAPIs() []activityPauseAPI { | |
| }) | ||
| return err | ||
| }, | ||
| unpause: func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string, resetAttempts bool) error { | ||
| unpause: func(ctx context.Context, s *testcore.TestEnv, wfID, actID, identity string) error { | ||
| _, err := s.FrontendClient().UnpauseActivityExecution(ctx, &workflowservice.UnpauseActivityExecutionRequest{ | ||
| Namespace: s.Namespace().String(), | ||
| WorkflowId: wfID, | ||
| ActivityId: actID, | ||
| Identity: identity, | ||
| ResetAttempts: resetAttempts, | ||
| Namespace: s.Namespace().String(), | ||
| WorkflowId: wfID, | ||
| ActivityId: actID, | ||
| Identity: identity, | ||
| }) | ||
| return err | ||
| }, | ||
|
|
@@ -211,7 +222,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| s.Equal(testReason, description.PendingActivities[0].PauseInfo.GetManual().Reason) | ||
|
|
||
| // unpause the activity | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| var out string | ||
| err = workflowRun.Get(ctx, &out) | ||
|
|
@@ -329,7 +340,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| shouldSucceed.Store(true) | ||
|
|
||
| // unpause the activity | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| // wait for activity to complete | ||
| await.Require(t.Context(), t, func(t *await.T) { | ||
|
|
@@ -425,7 +436,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| s.Equal(testReason, description.PendingActivities[0].PauseInfo.GetManual().Reason) | ||
|
|
||
| // unpause the activity | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| // wait for activity to complete | ||
| await.Require(t.Context(), t, func(t *await.T) { | ||
|
|
@@ -505,7 +516,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| require.NoError(t, api.pause(ctx, s, workflowRun.GetID(), "activity-id", "", "", testRequestID)) | ||
|
|
||
| // unpause the activity | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| // wait for activity to complete. It should happen immediately since noWait is set | ||
| await.Require(t.Context(), t, func(t *await.T) { | ||
|
|
@@ -520,6 +531,9 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
|
|
||
| t.Run("TestActivityPauseApi_WithReset", func(t *testing.T) { | ||
| // pause/unpause the activity with reset option and noWait flag | ||
| if api.unpauseResettingAttempts == nil { | ||
| t.Skip("this API has no reset_attempts flag on unpause; Reset is the operation that restarts attempts") | ||
| } | ||
| s := testcore.NewEnv(t) | ||
|
|
||
| initialRetryInterval := 1 * time.Second | ||
|
|
@@ -599,7 +613,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| activityWasReset = true | ||
|
|
||
| // unpause the activity with reset | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", true)) | ||
| require.NoError(t, api.unpauseResettingAttempts(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| // wait for activity to be running | ||
| await.Require(t.Context(), t, func(t *await.T) { | ||
|
|
@@ -739,7 +753,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
| s.Equal(testReason, description.PendingActivities[0].PauseInfo.GetManual().Reason) | ||
|
|
||
| // unpause the activity | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, workflowRun.GetID(), "activity-id", "")) | ||
|
|
||
| var out string | ||
| err = workflowRun.Get(ctx, &out) | ||
|
|
@@ -920,7 +934,7 @@ func TestActivityApiPauseClientTestSuite(t *testing.T) { | |
|
|
||
| // step 4: unpause | ||
| activityWasReset.Store(true) | ||
| require.NoError(t, api.unpause(ctx, s, wfID, "activity-id", "", false)) | ||
| require.NoError(t, api.unpause(ctx, s, wfID, "activity-id", "")) | ||
|
|
||
| await.Require(t.Context(), t, func(c *await.T) { | ||
| desc, err := s.SdkClient().DescribeWorkflowExecution(ctx, workflowRun.GetID(), workflowRun.GetRunID()) | ||
|
|
||
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.
Not introduced here, but this change makes it the whole story for the API, so worth confirming it's intended: the two backends of
UnpauseActivityExecutionnow disagree on retry-backoff timing.workflow.UnpauseActivityregenerates the retry task atnow(+jitter)whenever the activity isSCHEDULED(service/history/workflow/activity.go:401-410), independent of the reset flags — so unpause drops the remaining backoff and dispatches immediately.unpauseDispatchTimenow always consultsdispatchTimeForRetry, so unpause waits out the remaining backoff.tests/activity_standalone_test.go:11095asserts exactly that ("unpause must honor the remaining retry backoff").Concretely: pause an activity sitting in a 30s retry backoff, then unpause. A workflow activity runs right away; a standalone activity waits for the original retry deadline. Previously
reset_attempts=truegave the standalone path the workflow path's timing; with the flag gone, the only way to skip the backoff on a standalone activity isResetActivityExecution, which also resets the attempt count and clears heartbeat details.If the intent is that unpause is purely "resume", the legacy workflow path is the odd one out and may deserve a follow-up issue.
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.
This is something to fix in the workflow activity parity drive post saa release
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.
This is intended: we will bring WFA into parity with SAA later. Neither have this API at GA.