Commit 789dff18 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: non-READY jobs should also become SEMAPHORED, unless they are running

Running jobs are claimed by workers, and workers don't expect jobs to
become bloked again, so they would ignore the SEMAPHORED state anyway
parent 2bba96a1
......@@ -435,7 +435,7 @@ sub semaphore_job_by_id { # used in the end of reblocking a semaphore chain
my $self = shift @_;
my $job_id = shift @_ or return;
my $sql = "UPDATE job SET status = 'SEMAPHORED' WHERE job_id=? AND status='READY'";
my $sql = "UPDATE job SET status = 'SEMAPHORED' WHERE job_id=? AND status NOT IN ('CLAIMED', 'COMPILATION', $ALL_STATUSES_OF_RUNNING_JOBS)";
$self->dbc->protected_prepare_execute( [ $sql, $job_id ],
sub { my ($after) = @_; $self->db->get_LogMessageAdaptor->store_hive_message( 'semaphoring a job'.$after, 'INFO' ); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment