#!/bin/sh # # Sometimes a MINION dies and never tells WEBAPP that a job is # finished. This makes the list of jobs grow to max size, which # stops WEBAPP from scheduling more jobs to run. This scripts # EXTERMINATEs such jobs. Do NOT run it casually, you MUST check # that it is OK to EXTERMINATE the job first. Davros has spoken. # # This is a STOPGAP until Lorry Controller deals with this # automatically. # Not using -e so that curl failing won't stop things. curl may # fail if the job isn't in the expected state. We want to # EXTERMINATE it anyway. set -u for jobid in "$@" do curl -s -X POST --data "job_id=$jobid" http://localhost:12765/1.0/stop-job curl -s -X POST --data "job_id=$jobid&exit=125&stdout=&stderr=" http://localhost:12765/1.0/job-update curl -s -X POST --data "job_id=$jobid" http://localhost:12765/1.0/remove-job done > /dev/null