QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
794 stars 214 forks source link

Failures to retrieve data from marathon cause blank haproxy config files to be written #124

Closed dkesler closed 9 years ago

dkesler commented 9 years ago

haproxy/haproxy.go's GetTemplateData method ignores errors retrieving data from marathon and zookeeper, and itself does not return errors. This means that consumers of the method (i.e. event_handler.go's handleHAPUpdate) still attempt to use the (bad) data returned by GetTemplateData. This ultimately results in the haproxy config template to be rendered with no services available.

GetTemplateData should propogate errors upwards, and handleHAPUpdate should not process the haproxy config template in the event that GetTemplateData returns an error.

This is easily reproducable by stopping all marathon instances in an environment and looking at the generated haproxy config file.

j1n6 commented 9 years ago

closed by #125