From a2f8f1d93a561f0d022650e7ee6999664aa7936e Mon Sep 17 00:00:00 2001 From: Rosie Kern <160497849+rk1274@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:10:45 +0000 Subject: [PATCH] Alter docs to reflect changes made to --queues_avoid (#116) * Alter docs to reflect changes made to --queues_avoid --- cmd/cron.go | 2 +- cmd/multi.go | 2 +- cmd/root.go | 4 ++-- cmd/walk.go | 2 +- scheduler/scheduler.go | 2 +- scheduler/scheduler_test.go | 4 ++-- walk/walk.go | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/cron.go b/cmd/cron.go index e3427c1e..ec3ed627 100644 --- a/cmd/cron.go +++ b/cmd/cron.go @@ -109,7 +109,7 @@ func init() { cronCmd.Flags().StringVar(&multiCh, "ch", "", "passed through to 'wrstat walk'") cronCmd.Flags().StringVar(&forcedQueue, "queue", "", "force a particular queue to be used when scheduling jobs") cronCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "", - "force queues with this substring to be avoided when scheduling jobs") + "force queues that include a substring from this comma-separated list to be avoided when scheduling jobs") cronCmd.Flags().IntVarP(&maxMem, "max_mem", "m", defaultMaxRAM, "maximum MBs to reserve for any job") cronCmd.Flags().StringVarP(&crontab, "crontab", "c", diff --git a/cmd/multi.go b/cmd/multi.go index 78e893b0..60e8e5cd 100644 --- a/cmd/multi.go +++ b/cmd/multi.go @@ -126,7 +126,7 @@ func init() { multiCmd.Flags().StringVar(&multiCh, "ch", "", "passed through to 'wrstat walk'") multiCmd.Flags().StringVar(&forcedQueue, "queue", "", "force a particular queue to be used when scheduling jobs") multiCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "", - "force queues with this substring to be avoided when scheduling jobs") + "force queues that include a substring from this comma-separated list to be avoided when scheduling jobs") multiCmd.Flags().IntVarP(&maxMem, "max_mem", "m", defaultMaxRAM, "maximum MBs to reserve for any job") } diff --git a/cmd/root.go b/cmd/root.go index 95407d61..78461157 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -146,8 +146,8 @@ func die(msg string, a ...interface{}) { // function you should defer. // // If you provide a non-blank queue, that queue will be used when scheduling. If -// you provide a non-black queuesAvoid, queues with that substring will be -// avoided. +// you provide a non-black queuesAvoid, queues including a substring from the +// list will be avoided. func newScheduler(cwd, queue, queuesAvoid string, sudo bool) (*scheduler.Scheduler, func()) { if runJobs != "" { return testScheduler(sudo) diff --git a/cmd/walk.go b/cmd/walk.go index 085e8016..eb3d4ac4 100644 --- a/cmd/walk.go +++ b/cmd/walk.go @@ -122,7 +122,7 @@ func init() { walkCmd.Flags().StringVar(&walkCh, "ch", "", "passed through to 'wrstat stat'") walkCmd.Flags().StringVarP(&forcedQueue, "queue", "q", "", "force a particular queue to be used when scheduling jobs") walkCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "", - "force queues with this substring to be avoided when scheduling jobs") + "force queues that include a substring from this comma-separated list to be avoided when scheduling jobs") } // checkArgs checks we have required args and returns desired dir. diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index 11bdabad..76d5eedc 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -65,7 +65,7 @@ type Scheduler struct { // deployment, timeout and logger. Added jobs will have the given cwd, which // matters. If cwd is blank, the current working dir is used. If queue is not // blank, that queue will be used during NewJob(). If queuesAvoid is not blank, -// queues including that substring will be avoided during NewJob(). +// queues including a substring from the list will be avoided during NewJob(). func New(deployment, cwd, queue, queuesAvoid string, timeout time.Duration, logger log15.Logger) (*Scheduler, error) { cwd, err := pickCWD(cwd) if err != nil { diff --git a/scheduler/scheduler_test.go b/scheduler/scheduler_test.go index 8dec036e..1bba2af0 100644 --- a/scheduler/scheduler_test.go +++ b/scheduler/scheduler_test.go @@ -195,7 +195,7 @@ func TestStatFile(t *testing.T) { }) Convey("You can make a Scheduler with queues to avoid", func() { - s, err := New(deployment, "", "", "avoid", timeout, logger) + s, err := New(deployment, "", "", "avoid,queue", timeout, logger) So(err, ShouldBeNil) So(s, ShouldNotBeNil) @@ -203,7 +203,7 @@ func TestStatFile(t *testing.T) { job := s.NewJob("cmd", "rep", "req", "", "", nil) So(job.Requirements.RAM, ShouldEqual, dreq.RAM) So(job.Override, ShouldEqual, 0) - So(job.Requirements.Other, ShouldResemble, map[string]string{"scheduler_queues_avoid": "avoid"}) + So(job.Requirements.Other, ShouldResemble, map[string]string{"scheduler_queues_avoid": "avoid,queue"}) }) }) diff --git a/walk/walk.go b/walk/walk.go index a6bdc369..bc868f7a 100644 --- a/walk/walk.go +++ b/walk/walk.go @@ -245,7 +245,7 @@ type flowController struct { } func newController() *flowController { - return controllerPool.Get().(*flowController) //nolint:forcetypeassert + return controllerPool.Get().(*flowController) //nolint:forcetypeassert,errcheck } func (f *flowController) GetControl() chan<- Dirent {