Repository navigation
Fence ClusterWorkflowEngine activity resets against stale runners - #10226
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: edbfcfe The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes EFF-3225
Follow-up to #10001, for one gap that came up while looking at #10058.
resetActivityAttemptcalledsharding.reset(requestId)with noexpectedReplyId, so storage ran an unconditional delete of the activity'sWithExitreply. Here is how a runner that has lost its shard can use that to delete the new owner's result:Suspendedactivity reply.Success, then continues with that value.Change
resetActivityAttemptreads the stored reply. It resets only when that reply isSuspended, and passes the reply's id asexpectedReplyId, the same wayresumealready does. If a newer reply is there, storage skips the delete and the activity loop's nextclient.activitycall returns the stored reply. The code doesn't look atreset's return value, because both memory and SQL storage return success when the compare fails.sendResumeParentnow passes the id of the reply it just read too. The worst case there was an extra wake, so this one is mostly for consistency.There are no storage, schema or
RunnerStoragechanges. This is not the epoch fence proposed in #10058, and this PR leaves that issue open.Test
keeps a newer activity reply when a stale Suspended reply resets the attemptinClusterWorkflowEngine.test.tsuses memory storage. It holds the replay's reset atclearReplies, resets the same attempt as the owner, and waits forComplete(1). Then it releases the stale reset. Onmainthe workflow ends with2because the activity ran twice. With this change it ends with1and the owner's reply stays in storage.pnpm test --run packages/effect/test/cluster/(285 tests),pnpm lint-fixandpnpm checkall pass locally.