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

Job queue with the introduction of blocked evaluations #726

Merged
merged 10 commits into from
Feb 1, 2016

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Jan 31, 2016

This PR introduces a new, blocked state for evals. Evaluations are entered into the blocked state when an evaluation creates failed allocations and is moved from the blocked state into the pending state when a node has capacity to run the evaluation. In this way, a job queue is created.

func (b *BlockedEvals) SetEnabled(enabled bool) {
b.l.Lock()
b.enabled = enabled
if !b.running {
Copy link
Member

Choose a reason for hiding this comment

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

Running and enabled seem redundant. Is it ever running when not enabled or visa versa?

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 protects against the case of calling SetEnabled(true) multiple times. Only spawns one go routine.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but you can just check if enabled is already true in that case. E.g. if enabled == running in all cases, so no need to have both.

@armon
Copy link
Member

armon commented Feb 1, 2016

Left some feedback, but LGTM

dadgar added a commit that referenced this pull request Feb 1, 2016
Job queue with the introduction of blocked evaluations
@dadgar dadgar merged commit ffa1f4f into master Feb 1, 2016
@dadgar dadgar deleted the f-blocked-evals branch February 1, 2016 23:44
@c4milo
Copy link
Contributor

c4milo commented Feb 2, 2016

should the documentation in https://www.nomadproject.io/docs/internals/scheduling.html be updated to reflect this new queue?

@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 Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants