my $maxfin=0;
while (my ($j,$st,$fin) = $starvation_q->fetchrow_array()) {
if ($st eq 'preparing' ||
- $st eq 'queued' ||
- $st eq 'running') {
+ $st eq 'queued') {
$w++;
+ } elsif ($st eq 'running') {
+ # We don't quit if there are still jobs running. Instead
+ # we wait until they are done and then see if how much we
+ # would be delaying their results. This does mean that a
+ # flight can be kept going, rather than being treated as
+ # starved, by a constant trickle of late jobs. But that
+ # is indistinguishable from a flight which is at the head
+ # of the queue for a small set of resources.
+ return (0, "job $j status $st, don't give up just yet");
} else {
$d++;
return (0, "job $j status $st but no step finished time!")