Skip to content

Propagate SuspendActor error up from substrate - #464

Merged
YoyinZyc merged 1 commit into
google:mainfrom
YoyinZyc:issue_441
Oct 14, 2026
Merged

YoyinZyc merged 1 commit into
google:mainfrom
YoyinZyc:issue_441

Conversation

@YoyinZyc

Copy link
Copy Markdown
Collaborator

Fix #441

Return an error if substrate fails to suspend the actor instead of swallowing it with a warning log.

It ensures the following behavior:

  1. retain the previous status if the substrate operation is failed
  2. suspend the already suspended actor returns ok ref
  3. update the store only if the substrate operation returns success.

Tests:

  • internal/controller/reconciler_test.go: Add TestTaskReconciler_SuspendError to verify Reconcile returns an error and preserves WorkerIp and Conditions when SuspendActor fails.
  • internal/server/server_test.go: Add TestServer_SuspendTask_ReconcileErrorRetainsRunningState and TestServer_SuspendTask_SuccessUpdatesStoredState to verify SuspendTask error propagation and store state persistence.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @YoyinZyc, checking Substrate's own suspend code before relying on it was exactly the right instinct. LGTM, with one small ask in #468 about the create path.

Comment thread internal/controller/reconciler.go Resolved
…ion.

This prevents SuspendTask from persisting a false Suspended status when
the underlying actor remains running.
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.

SuspendTask reports success and persists Suspended when Substrate suspension fails

3 participants