Skip to content
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

scheduler: Fix bug where the would treat multiregion jobs as paused for job types that don't use deployments #14659

Merged
merged 4 commits into from
Sep 22, 2022

Conversation

DerekStrickland
Copy link
Contributor

@DerekStrickland DerekStrickland commented Sep 22, 2022

This PR fixes a bug in the allocReconciler where multiregion job types that don't support deployments would be flagged as paused.

  • structs.Job - Added a UsesDeployments function that can be expanded as more job types support deployments
  • scheduler.allocReconciler - Added check to computeDeploymentPaused to guard against setting deploymentPaused = true if the job type doesn't use deployments.

@DerekStrickland DerekStrickland added backport/1.2.x backport to 1.1.x release line backport/1.3.x backport to 1.3.x release line labels Sep 22, 2022
@DerekStrickland DerekStrickland self-assigned this Sep 22, 2022
Comment on lines +5752 to +5757
switch j.Type {
case JobTypeService:
return true
default:
return false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this not be simplified?

Suggested change
switch j.Type {
case JobTypeService:
return true
default:
return false
}
return j.Type == JobTypeService

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could, but I intentionally did this since a goal is to support Deployments for more job types in the future. Maybe this is premature? I was hoping the team would discuss so thanks for taking the bait!

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM

.changelog/14659.txt Outdated Show resolved Hide resolved
Co-authored-by: Tim Gross <tgross@hashicorp.com>
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.2.x backport to 1.1.x release line backport/1.3.x backport to 1.3.x release line theme/enterprise Issues related to Enterprise features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants