From 61be99bb43c94bf4c41047496917f1b69ff46ab3 Mon Sep 17 00:00:00 2001
From: Leo Gordon <lg4@ebi.ac.uk>
Date: Mon, 28 Nov 2011 09:57:17 +0000
Subject: [PATCH] making sure semaphores are correctly propagated through
 gc_dataflow and PASSED_ON state

---
 modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
index 62e0d73dc..c8bf32f81 100644
--- a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+++ b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
@@ -665,6 +665,10 @@ sub gc_dataflow {
     $job->dataflow_output_id( $job->input_id() , $branch_name );
 
     $job->update_status('PASSED_ON');
+
+    if(my $semaphored_job_id = $job->semaphored_job_id) {
+        $self->decrease_semaphore_count_for_jobid( $semaphored_job_id );    # step-unblock the semaphore
+    }
     
     return 1;
 }
-- 
GitLab