{"action":"created","issue":{"url":"https://api.github.com/repos/QubitProducts/bamboo/issues/143","labels_url":"https://api.github.com/repos/QubitProducts/bamboo/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/QubitProducts/bamboo/issues/143/comments","events_url":"https://api.github.com/repos/QubitProducts/bamboo/issues/143/events","html_url":"https://github.com/QubitProducts/bamboo/issues/143","id":93204909,"number":143,"title":"Bamboo add tasks too early to haProxy","user":{"login":"dplate","id":4716088,"avatar_url":"https://avatars.githubusercontent.com/u/4716088?v=3","gravatar_id":"","url":"https://api.github.com/users/dplate","html_url":"https://github.com/dplate","followers_url":"https://api.github.com/users/dplate/followers","following_url":"https://api.github.com/users/dplate/following{/other_user}","gists_url":"https://api.github.com/users/dplate/gists{/gist_id}","starred_url":"https://api.github.com/users/dplate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dplate/subscriptions","organizations_url":"https://api.github.com/users/dplate/orgs","repos_url":"https://api.github.com/users/dplate/repos","events_url":"https://api.github.com/users/dplate/events{/privacy}","received_events_url":"https://api.github.com/users/dplate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-06T06:52:26Z","updated_at":"2015-07-28T08:33:24Z","closed_at":null,"body":"We're using Marathon/Bamboo/HAProxy. When we deploy a new version of an app or just scale it up, we're seeing 503 (service unavailable) responses for a short time from our requests to HAProxy.\r\n\r\nIt looks like the reason is:\r\nMarathon reports the new task as soon as possible to Bamboo (before the deployment has finished and the first successful health check). Bamboo directly changes the configuration of HAProxy. After the restart of HAProxy, all instances of a cluster are active. It doesn't check them via health check first. The reasons for this are mentioned here:\r\nhttp://comments.gmane.org/gmane.comp.web.haproxy/14789\r\n\r\nTo solve this, I would like to use the health check status, which is exposed by Marathon:\r\nhttps://mesosphere.github.io/marathon/docs/rest-api.html#get-/v2/tasks\r\nI think the unchecked/unhealthy tasks could be filtered out here:\r\nhttps://github.com/QubitProducts/bamboo/blob/master/services/marathon/marathon.go#L179\r\n\r\nAny thoughts or concerns regarding this idea?"},"comment":{"url":"https://api.github.com/repos/QubitProducts/bamboo/issues/comments/125503331","html_url":"https://github.com/QubitProducts/bamboo/issues/143#issuecomment-125503331","issue_url":"https://api.github.com/repos/QubitProducts/bamboo/issues/143","id":125503331,"user":{"login":"drewrobb","id":140935,"avatar_url":"https://avatars.githubusercontent.com/u/140935?v=3","gravatar_id":"","url":"https://api.github.com/users/drewrobb","html_url":"https://github.com/drewrobb","followers_url":"https://api.github.com/users/drewrobb/followers","following_url":"https://api.github.com/users/drewrobb/following{/other_user}","gists_url":"https://api.github.com/users/drewrobb/gists{/gist_id}","starred_url":"https://api.github.com/users/drewrobb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewrobb/subscriptions","organizations_url":"https://api.github.com/users/drewrobb/orgs","repos_url":"https://api.github.com/users/drewrobb/repos","events_url":"https://api.github.com/users/drewrobb/events{/privacy}","received_events_url":"https://api.github.com/users/drewrobb/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T08:33:24Z","updated_at":"2015-07-28T08:33:24Z","body":"I've taken a stab at implementing this here: https://github.com/drewrobb/bamboo/tree/dr/health. \r\n\r\nFor my usage I'm adding ` {{ if $task.Healthy }} ` filtering in the haproxy template. May turn this into a proper PR soon."}}