{"action":"opened","number":241,"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241","id":75513207,"html_url":"https://github.com/mesosphere/marathon-lb/pull/241","diff_url":"https://github.com/mesosphere/marathon-lb/pull/241.diff","patch_url":"https://github.com/mesosphere/marathon-lb/pull/241.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon-lb/issues/241","number":241,"state":"open","locked":false,"title":"Over-ride initial instances when it is greater than deployment target instances to prevent infinite loop in zdd.","user":{"login":"ajays20078","id":1866673,"avatar_url":"https://avatars.githubusercontent.com/u/1866673?v=3","gravatar_id":"","url":"https://api.github.com/users/ajays20078","html_url":"https://github.com/ajays20078","followers_url":"https://api.github.com/users/ajays20078/followers","following_url":"https://api.github.com/users/ajays20078/following{/other_user}","gists_url":"https://api.github.com/users/ajays20078/gists{/gist_id}","starred_url":"https://api.github.com/users/ajays20078/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajays20078/subscriptions","organizations_url":"https://api.github.com/users/ajays20078/orgs","repos_url":"https://api.github.com/users/ajays20078/repos","events_url":"https://api.github.com/users/ajays20078/events{/privacy}","received_events_url":"https://api.github.com/users/ajays20078/received_events","type":"User","site_admin":false},"body":"Currently when `args.initial_instances` is greater than `deployment_target_instances`(`HAPROXY_DEPLOYMENT_TARGET_INSTANCES`), zdd script goes into infinite loop.\r\n\r\nIt sets `app['instances'] = args.initial_instances` [here](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L516) as a part of [prepare_deploy](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L560) function call. And then the control flows to [swap_zdd_apps](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L578),  and only way to return from this recursive function is when [ready_to_delete_old_app](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L323) is true(  the other way is when it enters [this](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L326) if  statement, which it will never enter when all old tasks are killed). But [ready_to_delete_old_app](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L347) will never return true as [new_app['instances'] is > deployment target](https://github.com/mesosphere/marathon-lb/blob/f9cb0426e4401c1e725596b37f0fe9c02d627e04/zdd.py#L348). So this results in infinite loop in swap_zdd_apps. \r\n\r\nSo in this PR initial_instances will be overridden by `deployment_target_instances` when  former is greater than later. Have updated `help` for the same.","created_at":"2016-06-28T16:59:36Z","updated_at":"2016-06-28T16:59:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c66f2d497fad6df356069facf23cca2296ffbed3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon-lb/issues/241/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon-lb/statuses/50f6bbb142a470f9a0ce7e8df3885484ce021ebf","head":{"label":"ajays20078:master","ref":"master","sha":"50f6bbb142a470f9a0ce7e8df3885484ce021ebf","user":{"login":"ajays20078","id":1866673,"avatar_url":"https://avatars.githubusercontent.com/u/1866673?v=3","gravatar_id":"","url":"https://api.github.com/users/ajays20078","html_url":"https://github.com/ajays20078","followers_url":"https://api.github.com/users/ajays20078/followers","following_url":"https://api.github.com/users/ajays20078/following{/other_user}","gists_url":"https://api.github.com/users/ajays20078/gists{/gist_id}","starred_url":"https://api.github.com/users/ajays20078/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajays20078/subscriptions","organizations_url":"https://api.github.com/users/ajays20078/orgs","repos_url":"https://api.github.com/users/ajays20078/repos","events_url":"https://api.github.com/users/ajays20078/events{/privacy}","received_events_url":"https://api.github.com/users/ajays20078/received_events","type":"User","site_admin":false},"repo":{"id":62154115,"name":"marathon-lb","full_name":"ajays20078/marathon-lb","owner":{"login":"ajays20078","id":1866673,"avatar_url":"https://avatars.githubusercontent.com/u/1866673?v=3","gravatar_id":"","url":"https://api.github.com/users/ajays20078","html_url":"https://github.com/ajays20078","followers_url":"https://api.github.com/users/ajays20078/followers","following_url":"https://api.github.com/users/ajays20078/following{/other_user}","gists_url":"https://api.github.com/users/ajays20078/gists{/gist_id}","starred_url":"https://api.github.com/users/ajays20078/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajays20078/subscriptions","organizations_url":"https://api.github.com/users/ajays20078/orgs","repos_url":"https://api.github.com/users/ajays20078/repos","events_url":"https://api.github.com/users/ajays20078/events{/privacy}","received_events_url":"https://api.github.com/users/ajays20078/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajays20078/marathon-lb","description":"Marathon-lb is a service discovery & load balancing tool for DC/OS","fork":true,"url":"https://api.github.com/repos/ajays20078/marathon-lb","forks_url":"https://api.github.com/repos/ajays20078/marathon-lb/forks","keys_url":"https://api.github.com/repos/ajays20078/marathon-lb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajays20078/marathon-lb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajays20078/marathon-lb/teams","hooks_url":"https://api.github.com/repos/ajays20078/marathon-lb/hooks","issue_events_url":"https://api.github.com/repos/ajays20078/marathon-lb/issues/events{/number}","events_url":"https://api.github.com/repos/ajays20078/marathon-lb/events","assignees_url":"https://api.github.com/repos/ajays20078/marathon-lb/assignees{/user}","branches_url":"https://api.github.com/repos/ajays20078/marathon-lb/branches{/branch}","tags_url":"https://api.github.com/repos/ajays20078/marathon-lb/tags","blobs_url":"https://api.github.com/repos/ajays20078/marathon-lb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajays20078/marathon-lb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajays20078/marathon-lb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajays20078/marathon-lb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajays20078/marathon-lb/statuses/{sha}","languages_url":"https://api.github.com/repos/ajays20078/marathon-lb/languages","stargazers_url":"https://api.github.com/repos/ajays20078/marathon-lb/stargazers","contributors_url":"https://api.github.com/repos/ajays20078/marathon-lb/contributors","subscribers_url":"https://api.github.com/repos/ajays20078/marathon-lb/subscribers","subscription_url":"https://api.github.com/repos/ajays20078/marathon-lb/subscription","commits_url":"https://api.github.com/repos/ajays20078/marathon-lb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajays20078/marathon-lb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajays20078/marathon-lb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajays20078/marathon-lb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajays20078/marathon-lb/contents/{+path}","compare_url":"https://api.github.com/repos/ajays20078/marathon-lb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajays20078/marathon-lb/merges","archive_url":"https://api.github.com/repos/ajays20078/marathon-lb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajays20078/marathon-lb/downloads","issues_url":"https://api.github.com/repos/ajays20078/marathon-lb/issues{/number}","pulls_url":"https://api.github.com/repos/ajays20078/marathon-lb/pulls{/number}","milestones_url":"https://api.github.com/repos/ajays20078/marathon-lb/milestones{/number}","notifications_url":"https://api.github.com/repos/ajays20078/marathon-lb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajays20078/marathon-lb/labels{/name}","releases_url":"https://api.github.com/repos/ajays20078/marathon-lb/releases{/id}","deployments_url":"https://api.github.com/repos/ajays20078/marathon-lb/deployments","created_at":"2016-06-28T15:46:46Z","updated_at":"2016-06-28T15:46:48Z","pushed_at":"2016-06-28T16:50:40Z","git_url":"git://github.com/ajays20078/marathon-lb.git","ssh_url":"git@github.com:ajays20078/marathon-lb.git","clone_url":"https://github.com/ajays20078/marathon-lb.git","svn_url":"https://github.com/ajays20078/marathon-lb","homepage":"","size":742,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"f9cb0426e4401c1e725596b37f0fe9c02d627e04","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":43829723,"name":"marathon-lb","full_name":"mesosphere/marathon-lb","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon-lb","description":"Marathon-lb is a service discovery & load balancing tool for DC/OS","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon-lb","forks_url":"https://api.github.com/repos/mesosphere/marathon-lb/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon-lb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon-lb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon-lb/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon-lb/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon-lb/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon-lb/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon-lb/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon-lb/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon-lb/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon-lb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon-lb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon-lb/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon-lb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon-lb/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon-lb/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon-lb/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon-lb/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon-lb/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon-lb/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon-lb/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon-lb/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon-lb/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon-lb/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon-lb/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon-lb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon-lb/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon-lb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon-lb/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon-lb/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon-lb/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon-lb/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon-lb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon-lb/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon-lb/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon-lb/deployments","created_at":"2015-10-07T16:36:32Z","updated_at":"2016-06-28T07:47:00Z","pushed_at":"2016-06-28T16:59:36Z","git_url":"git://github.com/mesosphere/marathon-lb.git","ssh_url":"git@github.com:mesosphere/marathon-lb.git","clone_url":"https://github.com/mesosphere/marathon-lb.git","svn_url":"https://github.com/mesosphere/marathon-lb","homepage":"","size":742,"stargazers_count":164,"watchers_count":164,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":21,"forks":98,"open_issues":21,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241"},"html":{"href":"https://github.com/mesosphere/marathon-lb/pull/241"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/issues/241"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon-lb/statuses/50f6bbb142a470f9a0ce7e8df3885484ce021ebf"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":8,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"ajays20078"}}