- Notifications
You must be signed in to change notification settings - Fork948
feat: prioritize human-initiated workspace builds over prebuilds in queue#18882
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
…ueueThis change implements a priority queue system for provisioner jobs to ensurethat human-initiated workspace builds are processed before prebuild jobs,improving user experience during high queue periods.Changes:- Add priority column to provisioner_jobs table (1=human, 0=prebuild)- Update AcquireProvisionerJob query to order by priority DESC, created_at ASC- Set priority in workspace builder based on initiator (PrebuildsSystemUserID)- Expose priority field in API and SDK- Add comprehensive test for priority queue behaviorCo-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
johnstcn left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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'd rather not add a new column here, as this requires a migration and migrations are difficult to backport, and this seems like something we would want to backport. We could instead add an explicitCASE WHEN
oninitiator_id
to perform the ordering.
EDIT: can you please also link an associated GH issue, if it exists?
Summary
Implements a priority queue system for provisioner jobs to ensure human-initiated workspace builds are processed before prebuild jobs, improving user experience during high queue periods.
Changes
priority
column toprovisioner_jobs
table with migrationAcquireProvisionerJob
query to order bypriority DESC, created_at ASC
How it works
PrebuildsSystemUserID
priority = 1
, prebuild jobs getpriority = 0
AcquireProvisionerJob
query now orders by priority first, then creation timeTesting
Impact
Fixes the issue where prebuilds could delay human-initiated workspace builds during busy periods.