6356: crunch-job doesn't create new tasks after job success is set.
authorBrett Smith <brett@curoverse.com>
Mon, 9 Nov 2015 13:30:14 +0000 (08:30 -0500)
committerBrett Smith <brett@curoverse.com>
Thu, 12 Nov 2015 20:30:51 +0000 (15:30 -0500)
commite8f3520fd515b0aaee92193b0b59c85839e2da4c
treeab1742f663881a58c0089efa6be879f8edd6001a
parent209d83a0ce0bd22669a39f49daddca432babeae7
6356: crunch-job doesn't create new tasks after job success is set.

#6356 reported that a permanently failed task was retried.  Note 3
discusses why this happened and suggests two fixes:

* Only put tempfailed task back on the todo list.
* Run `last THISROUND if $main::please_freeze || defined($main::success);`
  after we call reapchildren(), since it's the main place where the
  value of $main::success can change.

The first change would revert part of
75be7487c2bbd83aa5116aa5f8ade5ddf31501da, which intentionally puts
these tasks back on the todo list to get a correct tasks count.

The current `last if…` line was added in
b306eb48ab12676ffb365ede8197e4f2d7e92011, with the rationale "Don't
create new tasks if $main::success is defined."  This change corrects
the code to implement the desired functionality, by checking and
stopping just before we create a new task (functionally, at least).
sdk/cli/bin/crunch-job