From 7d7c2b1bd6fe1ff9b0fbaec2d5ea8f6ef32db35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 16 Jun 2022 10:36:30 +0200 Subject: [PATCH] =?UTF-8?q?Cleanup:=20blacklist=20=E2=86=92=20blocklist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change "blacklist" to "blocklist", because that makes people happier. No functional changes. --- internal/manager/config/config.go | 2 +- internal/manager/config/defaults.go | 2 +- internal/manager/persistence/task_scheduler.go | 4 ++-- internal/manager/persistence/task_scheduler_test.go | 2 +- internal/manager/task_state_machine/task_state_machine.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/manager/config/config.go b/internal/manager/config/config.go index 601a9cd7..87767bd4 100644 --- a/internal/manager/config/config.go +++ b/internal/manager/config/config.go @@ -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). diff --git a/internal/manager/config/defaults.go b/internal/manager/config/defaults.go index 7bfa71fd..ac542f9d 100644 --- a/internal/manager/config/defaults.go +++ b/internal/manager/config/defaults.go @@ -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)}, diff --git a/internal/manager/persistence/task_scheduler.go b/internal/manager/persistence/task_scheduler.go index 5584c744..2669cada 100644 --- a/internal/manager/persistence/task_scheduler.go +++ b/internal/manager/persistence/task_scheduler.go @@ -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). diff --git a/internal/manager/persistence/task_scheduler_test.go b/internal/manager/persistence/task_scheduler_test.go index a6f05451..dcd24a11 100644 --- a/internal/manager/persistence/task_scheduler_test.go +++ b/internal/manager/persistence/task_scheduler_test.go @@ -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 diff --git a/internal/manager/task_state_machine/task_state_machine.go b/internal/manager/task_state_machine/task_state_machine.go index dd1f755f..9b55f2ed 100644 --- a/internal/manager/task_state_machine/task_state_machine.go +++ b/internal/manager/task_state_machine/task_state_machine.go @@ -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