diff --git a/CHANGELOG.md b/CHANGELOG.md index 8adb0235f..7b8d261b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.4.1 (Unreleased) + +BUG FIXES: + + * Fixing only a single watch being run by an agent [GH-337] + * Fixing potential race in connection multiplexing + ## 0.4.0 (September 5, 2014) FEATURES: diff --git a/command/agent/command.go b/command/agent/command.go index 8058bfb0a..c096aac3b 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -464,13 +464,13 @@ func (c *Command) Run(args []string) int { // Register the watches for _, wp := range config.WatchPlans { - go func() { + go func(wp *watch.WatchPlan) { wp.Handler = makeWatchHandler(logOutput, wp.Exempt["handler"]) wp.LogOutput = c.logOutput if err := wp.Run(httpAddr); err != nil { c.Ui.Error(fmt.Sprintf("Error running watch: %v", err)) } - }() + }(wp) } // Let the agent know we've finished registration @@ -627,13 +627,13 @@ func (c *Command) handleReload(config *Config) *Config { // Register the new watches for _, wp := range newConf.WatchPlans { - go func() { + go func(wp *watch.WatchPlan) { wp.Handler = makeWatchHandler(c.logOutput, wp.Exempt["handler"]) wp.LogOutput = c.logOutput if err := wp.Run(httpAddr); err != nil { c.Ui.Error(fmt.Sprintf("Error running watch: %v", err)) } - }() + }(wp) } return newConf