Cleanup: blacklist → blocklist
Change "blacklist" to "blocklist", because that makes people happier. No functional changes.
This commit is contained in:
parent
6e12a2fb25
commit
7d7c2b1bd6
@ -92,7 +92,7 @@ type Base struct {
|
|||||||
|
|
||||||
/* This many failures (on a given job+task type combination) will ban a worker
|
/* This many failures (on a given job+task type combination) will ban a worker
|
||||||
* from that task type on that job. */
|
* from that task type on that job. */
|
||||||
// BlacklistThreshold int `yaml:"blacklist_threshold"`
|
// BlocklistThreshold int `yaml:"blocklist_threshold"`
|
||||||
|
|
||||||
// When this many workers have tried the task and failed, it will be hard-failed
|
// When this many workers have tried the task and failed, it will be hard-failed
|
||||||
// (even when there are workers left that could technically retry the task).
|
// (even when there are workers left that could technically retry the task).
|
||||||
|
@ -39,7 +39,7 @@ var defaultConfig = Conf{
|
|||||||
// // be accurate enough for this type of cleanup.
|
// // be accurate enough for this type of cleanup.
|
||||||
// TaskCleanupMaxAge: 14 * 24 * time.Hour,
|
// TaskCleanupMaxAge: 14 * 24 * time.Hour,
|
||||||
|
|
||||||
// BlacklistThreshold: 3,
|
// BlocklistThreshold: 3,
|
||||||
TaskFailAfterSoftFailCount: 3,
|
TaskFailAfterSoftFailCount: 3,
|
||||||
|
|
||||||
// WorkerCleanupStatus: []string{string(api.WorkerStatusOffline)},
|
// WorkerCleanupStatus: []string{string(api.WorkerStatusOffline)},
|
||||||
|
@ -83,7 +83,7 @@ func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) {
|
|||||||
task := Task{}
|
task := Task{}
|
||||||
|
|
||||||
// If a task is alreay active & assigned to this worker, return just that.
|
// If a task is alreay active & assigned to this worker, return just that.
|
||||||
// Note that this task type could be blacklisted or no longer supported by the
|
// Note that this task type could be blocklisted or no longer supported by the
|
||||||
// Worker, but since it's active that is unlikely.
|
// Worker, but since it's active that is unlikely.
|
||||||
assignedTaskResult := tx.
|
assignedTaskResult := tx.
|
||||||
Model(&task).
|
Model(&task).
|
||||||
@ -122,7 +122,7 @@ func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) {
|
|||||||
Where("jobs.status in ?", schedulableJobStatuses). // Schedulable job statuses
|
Where("jobs.status in ?", schedulableJobStatuses). // Schedulable job statuses
|
||||||
Where("tasks.type in ?", w.TaskTypes()). // Supported task types
|
Where("tasks.type in ?", w.TaskTypes()). // Supported task types
|
||||||
Where("tasks.id not in (?)", incompleteDepsQuery). // Dependencies completed
|
Where("tasks.id not in (?)", incompleteDepsQuery). // Dependencies completed
|
||||||
// TODO: Non-blacklisted
|
// TODO: Non-blocklisted
|
||||||
Order("jobs.priority desc"). // Highest job priority
|
Order("jobs.priority desc"). // Highest job priority
|
||||||
Order("tasks.priority desc"). // Highest task priority
|
Order("tasks.priority desc"). // Highest task priority
|
||||||
Limit(1).
|
Limit(1).
|
||||||
|
@ -259,7 +259,7 @@ func TestAssignedToOtherWorker(t *testing.T) {
|
|||||||
assert.Equal(t, *task.WorkerID, w.ID, "the task should now be assigned to the worker it was scheduled for")
|
assert.Equal(t, *task.WorkerID, w.ID, "the task should now be assigned to the worker it was scheduled for")
|
||||||
}
|
}
|
||||||
|
|
||||||
// To test: blacklists
|
// To test: blocklists
|
||||||
|
|
||||||
// To test: variable replacement
|
// To test: variable replacement
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ func (sm *StateMachine) requeueTasks(
|
|||||||
return "", fmt.Errorf("queueing tasks of job %s: %w", job.UUID, err)
|
return "", fmt.Errorf("queueing tasks of job %s: %w", job.UUID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: also reset the 'failed by workers' blacklist.
|
// TODO: also reset the 'failed by workers' blocklist.
|
||||||
|
|
||||||
// The appropriate tasks have been requeued, so now the job can go from "requeueing" to "queued".
|
// The appropriate tasks have been requeued, so now the job can go from "requeueing" to "queued".
|
||||||
return api.JobStatusQueued, nil
|
return api.JobStatusQueued, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user