9272: Fix up state transitions:
authorTom Clegg <tom@curoverse.com>
Fri, 27 May 2016 01:17:31 +0000 (21:17 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 27 May 2016 13:38:29 +0000 (09:38 -0400)
commitdbf2c829a79ef890c839a2f1498b455340e3ab51
tree7bd0a23c3c01ebb386a962692829eea83547e22c
parentbeae5797da09ec58008bb6d8d0359c2140fc7323
9272: Fix up state transitions:

* Change state to Running only at the last possible moment before
  starting the container.

* When erroring out before Running, change state back to Queued.

* Do not save log/output/exit code when changing state to Cancelled.

Incidental fixes:

* Clean up error handling in Run()

* Don't create a collection for (or try to attach to the container)
  the second "cleanup activities" log that gets opened after closing
  the real container log.
services/crunch-run/crunchrun.go
services/crunch-run/crunchrun_test.go