Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fix #377: A disabled task event should unsubscribe task dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
geauxvirtual committed Oct 8, 2015
1 parent dcf9716 commit c65ac12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (s *scheduler) StartTask(id string) []perror.PulseError {

mts, plugins := s.gatherMetricsAndPlugins(t.workflow)
cps := returnCorePlugin(plugins)
errs := s.metricManager.SubscribeDeps(id, mts, cps)
errs := s.metricManager.SubscribeDeps(t.ID(), mts, cps)
if len(errs) > 0 {
return errs
}
Expand Down Expand Up @@ -384,6 +384,11 @@ func (s *scheduler) HandleGomitEvent(e gomit.Event) {
"task-id": v.TaskID,
"disabled-reason": v.Why,
}).Debug("event received")
// We need to unsubscribe from deps when a task goes disabled
task, _ := s.getTask(v.TaskID)
mts, plugins := s.gatherMetricsAndPlugins(task.workflow)
cps := returnCorePlugin(plugins)
s.metricManager.UnsubscribeDeps(task.ID(), mts, cps)
s.taskWatcherColl.handleTaskDisabled(v.TaskID, v.Why)
default:
log.WithFields(log.Fields{
Expand Down

0 comments on commit c65ac12

Please sign in to comment.