-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
func (b *BlockedEvals) SetEnabled(enabled bool) { | ||
b.l.Lock() | ||
b.enabled = enabled | ||
if !b.running { |
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.
Running and enabled seem redundant. Is it ever running when not enabled or visa versa?
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.
It protects against the case of calling SetEnabled(true)
multiple times. Only spawns one go routine.
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, 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.
Left some feedback, but LGTM |
1340d64
to
cc2ee4f
Compare
Job queue with the introduction of blocked evaluations
should the documentation in https://www.nomadproject.io/docs/internals/scheduling.html be updated to reflect this new queue? |
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. |
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.