-
Notifications
You must be signed in to change notification settings - Fork 100
Use deployment_build_id as part of key for eager workflow start #1042
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
Use deployment_build_id as part of key for eager workflow start #1042
Conversation
| .any(|(_, opt)| { | ||
| opt.as_ref() == build_id.as_ref() | ||
| }) | ||
| && !skip_client_worker_set_check |
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.
Looks like this is right
| let worker_id = worker_list.choose(&mut rand::rng()); | ||
| if let Some(worker_entry) = worker_id | ||
| && let Some(worker) = self.all_workers.get(&worker_entry.0) | ||
| && let Some(slot) = worker.try_reserve_wft_slot() |
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.
In principle we should then try the next worker in the list if this reservation fails. In practice I doubt this is going to come up much. Probably not hard to add, but maybe annoying to test.
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.
Right, added the retry mechanism, and codex helped me write a solid test, with some minor tweaking/fixing of course
…t worker if reservation fails, added a test
| worker_list | ||
| .choose_multiple(&mut rng, worker_list.len()) |
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.
I I think can be written more readably as worker_list.as_slice().shuffle()
https://docs.rs/rand/latest/rand/seq/trait.SliceRandom.html#tymethod.shuffle
What was changed
Added
deployment_build_idas key for eager workflow slotWhy?
Valid use case that today causes an error
Checklist
Closes
How was this tested:
Note
Eager slot management now keys by namespace/task_queue/build_id, allows multiple local workers per queue with randomized selection/retry, updates duplicate-registration rules, and adds
randdependency.namespace+task_queue+deployment_build_id(storeVec<(Uuid, Option<String>)>), allowing multiple providers per queue when build IDs differ.namespace/task_queue/build_id; error message updated. Unregister removes only the specific worker and cleans up when empty.num_providersnow counts total providers across keys.WorkflowOptions.enable_eager_workflow_startdoc note updated to remove BuildID incompatibility warning (still experimental).randfor provider selection shuffling.Written by Cursor Bugbot for commit 427dd96. This will update automatically on new commits. Configure here.