16723: Reject invalid updates in API stub.
authorTom Clegg <tom@tomclegg.ca>
Fri, 21 Aug 2020 02:21:14 +0000 (22:21 -0400)
committerTom Clegg <tom@tomclegg.ca>
Fri, 21 Aug 2020 13:33:38 +0000 (09:33 -0400)
commit60bbffb69b908f7a1146fc0c1904aae2775cdf1e
tree785b5a02323a661e988f2b9c2bcead1d3686f291
parent27babdaf446a70fdd7742104846de9afd9b75b22
16723: Reject invalid updates in API stub.

When dispatcher notices crunch-run has exited and the last known state
is Locked, it requeues the container. If crunch-run changed the
container state to Running before exiting (and dispatcher hasn't
noticed yet), dispatcher relies on RailsAPI/controller to reject the
requeue attempt.

Without this, the scheduler's state=Queued call was being accepted
even after losing a race to the stub's state=Running call,
occasionally causing a container to run twice and fail the randomized
simulation test.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>
lib/dispatchcloud/dispatcher_test.go
lib/dispatchcloud/test/queue.go