Backport worker_may_ignore history handling#356
Open
d2army wants to merge 2 commits into
Open
Conversation
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
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.
Summary
worker_may_ignorehistory handling from the 0.1.x line totransfers-master/ 0.0.x without proto regeneration.History::Eventconstructable when a history event has an attributes oneof unknown to the old generated proto, soworker_may_ignorecan still be read.Why (#1)
History::Event#extract_attributescan receivenilfor an unknown attributes oneof and raise beforeworker_may_ignoreis read; making attribute extraction nil-safe keeps the compatibility bit reachable.Why (#2)
StateManager#apply_eventcallsHistory::EventTarget.from_event(event)before its event-type case statement, so unknown event prefixes can raise before the final unsupported-event branch is reached.worker_may_ignore=true, while still raising for unknown events that are not explicitly safe to ignore.Temporal team confirmation
Confirmed with the Temporal team that the relevant server-injected event types (
WORKFLOW_EXECUTION_OPTIONS_UPDATED,WORKFLOW_EXECUTION_PAUSED,WORKFLOW_EXECUTION_UNPAUSED,WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED, and the two server-injectedNEXUS_OPERATION_CANCEL_REQUEST_*events) carryworker_may_ignore=trueconsistently, including in existing histories. This makes the runtime-only patch sufficient — theworker_may_ignorerescue path handles them via the same flow upstream PR #355 uses, and proto regeneration is not required.Test plan
RBENV_VERSION=3.0.6 bundle exec rspec -r temporal/connection/grpc spec/unit/lib/temporal/workflow/history/event_spec.rb spec/unit/lib/temporal/workflow/state_manager_spec.rbRBENV_VERSION=3.0.6 ruby -c lib/temporal/workflow/history/event.rb && RBENV_VERSION=3.0.6 ruby -c lib/temporal/workflow/state_manager.rb && RBENV_VERSION=3.0.6 ruby -c spec/unit/lib/temporal/workflow/history/event_spec.rb && RBENV_VERSION=3.0.6 ruby -c spec/unit/lib/temporal/workflow/state_manager_spec.rb && git diff --check