Cleanup: blacklist → blocklist

Change "blacklist" to "blocklist", because that makes people happier.

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2022-06-16 10:36:30 +02:00
parent 6e12a2fb25
commit 7d7c2b1bd6
5 changed files with 6 additions and 6 deletions

View File

@ -92,7 +92,7 @@ type Base struct {
/* This many failures (on a given job+task type combination) will ban a worker
* 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
// (even when there are workers left that could technically retry the task).

View File

@ -39,7 +39,7 @@ var defaultConfig = Conf{
// // be accurate enough for this type of cleanup.
// TaskCleanupMaxAge: 14 * 24 * time.Hour,
// BlacklistThreshold: 3,
// BlocklistThreshold: 3,
TaskFailAfterSoftFailCount: 3,
// WorkerCleanupStatus: []string{string(api.WorkerStatusOffline)},

View File

@ -83,7 +83,7 @@ func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) {
task := Task{}
// 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.
assignedTaskResult := tx.
Model(&task).
@ -122,7 +122,7 @@ func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) {
Where("jobs.status in ?", schedulableJobStatuses). // Schedulable job statuses
Where("tasks.type in ?", w.TaskTypes()). // Supported task types
Where("tasks.id not in (?)", incompleteDepsQuery). // Dependencies completed
// TODO: Non-blacklisted
// TODO: Non-blocklisted
Order("jobs.priority desc"). // Highest job priority
Order("tasks.priority desc"). // Highest task priority
Limit(1).

View File

@ -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")
}
// To test: blacklists
// To test: blocklists
// To test: variable replacement

View File

@ -469,7 +469,7 @@ func (sm *StateMachine) requeueTasks(
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".
return api.JobStatusQueued, nil