Add preferred version provider to worker options#2942
Merged
Conversation
Sushisource
commented
Jul 8, 2026
| } | ||
| } | ||
|
|
||
| public static <T> T readOnly(Functions.Func<T> func) { |
Member
Author
There was a problem hiding this comment.
@Quinn-With-Two-Ns Seemed useful. LMK if you think I should refactor other sites to use this that are doing the same thing by hand.
Quinn-With-Two-Ns
approved these changes
Jul 8, 2026
tconley1428
approved these changes
Jul 9, 2026
694dc37 to
94c226f
Compare
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.
What was changed
Per a customer request, added a way to specify a "preferred" version to use when making a get version call which may not necessarily be the
maxVersionwhich would normally be used when agetVersioncall is encountered for the first time.This is accomplished by adding a worker option:
setPreferredVersionProviderwhich accepts a callback that can be used to determine the version for a given call.Why?
Users would like to have a way to perform a rolling deployment of a worker change that includes an introduction of a
getVersioncall to a workflow. Without this capability, such a rolling deployment means that if a worker with the new code picks up a task, runs the call, and then the workflow replays on the old code, a WFT failure occurs because the old code is missing the call. (The other direction is acceptable).This makes rolling deployments noisy, especially if they proceed slowly.
Checklist
Closes Add preferred version worker option #2941
How was this tested:
Added tests
Any docs updates needed?