{"action":"opened","issue":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/1215","labels_url":"https://api.github.com/repos/mesosphere/marathon/issues/1215/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/1215/comments","events_url":"https://api.github.com/repos/mesosphere/marathon/issues/1215/events","html_url":"https://github.com/mesosphere/marathon/issues/1215","id":57987035,"number":1215,"title":"Possible race condition on simultaneous application launch","user":{"login":"cgbaker","id":1675087,"avatar_url":"https://avatars.githubusercontent.com/u/1675087?v=3","gravatar_id":"","url":"https://api.github.com/users/cgbaker","html_url":"https://github.com/cgbaker","followers_url":"https://api.github.com/users/cgbaker/followers","following_url":"https://api.github.com/users/cgbaker/following{/other_user}","gists_url":"https://api.github.com/users/cgbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/cgbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgbaker/subscriptions","organizations_url":"https://api.github.com/users/cgbaker/orgs","repos_url":"https://api.github.com/users/cgbaker/repos","events_url":"https://api.github.com/users/cgbaker/events{/privacy}","received_events_url":"https://api.github.com/users/cgbaker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-17T21:43:39Z","updated_at":"2015-02-17T21:43:39Z","closed_at":null,"body":"Hi Folks!\r\n\r\nI'm running into a problem that appears at first glance to be a race condition on application launch. \r\n\r\nIf I launch multiple (in my case, 4) apps at the same time by POSTing to /v2/apps, I notice two things: \r\n1. They are all four assigned the same (formerly available) port (e.g., port 10000)\r\n2. I can only delete one of them via the UI or the REST API; the others have to be scaled down to zero before I can successfully delete them.\r\n\r\nThe outcome of the first symptom is sort of humorous, actually... the haproxy bridge configures port 10000 (in this example) against all four worker tasks, so that as I refresh, the proxy switches between the different apps. In the short term, I'm calling this RAaaS (Random Application as a Service) ;)\r\n\r\nI modified my launcher to protect app creation, with a 500ms delay between them. The symptoms that I'm seeing go away.\r\n\r\nI know I haven't given any actionable details: logs, payloads, etc, but I wanted to throw this out and see what folks think. If it seems like it may be an issue in Marathon and/or Mesos, let me know and I'll try to come up with a bash script or something to reproduce it.\r\n\r\nI'm running on Marathon 0.7.6, as built by Mesosphere; against Mesos 0.21.1, also built by Mesosphere. \r\n\r\nMany thanks,\r\n--cb "}}