Skip to content

Conversation

@owen-d
Copy link
Member

@owen-d owen-d commented Jan 2, 2025

Local branch copy of #15578 to debug possible fork permission issues

  • Removes max_jobs_planned_per_interval. We don't want this yet and it was being used incorrectly as the planners maxJobsPerPartition argument.
  • Hardcodes one job per partition during planning
  • enqueues the next job for some partition when the current one finishes.

Some of it is a bit hacky & will need refactoring, but this should work well enough in the meantime to flesh out issues.

@owen-d owen-d requested a review from a team as a code owner January 2, 2025 18:39
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jan 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2025

💻 Deploy preview deleted.


// find first job for this partition
nextJob := sort.Search(len(jobs), func(i int) bool {
return jobs[i].Job.Partition() >= job.Partition()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return jobs[i].Job.Partition() >= job.Partition()
return jobs[i].Job.Partition() == job.Partition()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That function probably works a bit different than you think :)

})

if nextJob < len(jobs) {
_, _, _ = s.idempotentEnqueue(jobs[nextJob])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a potential race here that could result in this operation to fail as we try to enqueue the same job from two different routines (from HandleCompleteJob or from the scheduler run loop). but this might not cause any problems

Copy link
Member Author

@owen-d owen-d Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ok since the enqueue code first checks the statusmap for existence of a job before adding it to the queue. We may need to introduce some error handling here or there to swallow these cases, but it shouldn't be possible to add duplicate jobs at the moment.

Copy link
Contributor

@ashwanthgoli ashwanthgoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ashwanthgoli ashwanthgoli merged commit b2f46de into main Jan 6, 2025
61 checks passed
@ashwanthgoli ashwanthgoli deleted the block-scheduler-one-job-per-partition branch January 6, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories

2 participants