{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/2443","labels_url":"https://api.github.com/repos/mesosphere/marathon/issues/2443/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/2443/comments","events_url":"https://api.github.com/repos/mesosphere/marathon/issues/2443/events","html_url":"https://github.com/mesosphere/marathon/issues/2443","id":111442062,"number":2443,"title":"Batch answers for service discovery end-points","user":{"login":"kolloch","id":339354,"avatar_url":"https://avatars.githubusercontent.com/u/339354?v=3","gravatar_id":"","url":"https://api.github.com/users/kolloch","html_url":"https://github.com/kolloch","followers_url":"https://api.github.com/users/kolloch/followers","following_url":"https://api.github.com/users/kolloch/following{/other_user}","gists_url":"https://api.github.com/users/kolloch/gists{/gist_id}","starred_url":"https://api.github.com/users/kolloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolloch/subscriptions","organizations_url":"https://api.github.com/users/kolloch/orgs","repos_url":"https://api.github.com/users/kolloch/repos","events_url":"https://api.github.com/users/kolloch/events{/privacy}","received_events_url":"https://api.github.com/users/kolloch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mesosphere/marathon/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mesosphere/marathon/milestones/22","html_url":"https://github.com/mesosphere/marathon/milestones/0.13.0","labels_url":"https://api.github.com/repos/mesosphere/marathon/milestones/22/labels","id":1284367,"number":22,"title":"0.13.0","description":"RC-1 will be released on 2015-10-16","creator":{"login":"mwasn","id":12829900,"avatar_url":"https://avatars.githubusercontent.com/u/12829900?v=3","gravatar_id":"","url":"https://api.github.com/users/mwasn","html_url":"https://github.com/mwasn","followers_url":"https://api.github.com/users/mwasn/followers","following_url":"https://api.github.com/users/mwasn/following{/other_user}","gists_url":"https://api.github.com/users/mwasn/gists{/gist_id}","starred_url":"https://api.github.com/users/mwasn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwasn/subscriptions","organizations_url":"https://api.github.com/users/mwasn/orgs","repos_url":"https://api.github.com/users/mwasn/repos","events_url":"https://api.github.com/users/mwasn/events{/privacy}","received_events_url":"https://api.github.com/users/mwasn/received_events","type":"User","site_admin":false},"open_issues":96,"closed_issues":20,"state":"open","created_at":"2015-09-01T15:54:59Z","updated_at":"2015-10-15T16:42:00Z","due_on":"2015-10-29T23:00:00Z","closed_at":null},"comments":2,"created_at":"2015-10-14T16:54:31Z","updated_at":"2015-10-15T16:51:51Z","closed_at":null,"body":"`/v2/tasks` (Accept: plain/text) is frequently hit by service discovery software.\r\n\r\nIf we use a simple caching strategy, we might violate expectations. For example, if we have sent an event that advertised that a task A has just died, the task A should not be included in the list of tasks retrieved as a result of this event.\r\n\r\nWhat we can do, though, is to batch requests. Rough outline of a potential algorithm:\r\n\r\n* For every incoming request:\r\n  * If we already have requests with the same parameters running, we save that request as `queued`.\r\n  * If we have no request with the same parameters running, we start a new computation of the response and use it to answer the request.\r\n* When a computation finishes:\r\n  * We answer all requests that started before the computation with it.\r\n  * If we have `queued` requests, we start a new computation."},"comment":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/comments/148453383","html_url":"https://github.com/mesosphere/marathon/issues/2443#issuecomment-148453383","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/2443","id":148453383,"user":{"login":"kolloch","id":339354,"avatar_url":"https://avatars.githubusercontent.com/u/339354?v=3","gravatar_id":"","url":"https://api.github.com/users/kolloch","html_url":"https://github.com/kolloch","followers_url":"https://api.github.com/users/kolloch/followers","following_url":"https://api.github.com/users/kolloch/following{/other_user}","gists_url":"https://api.github.com/users/kolloch/gists{/gist_id}","starred_url":"https://api.github.com/users/kolloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolloch/subscriptions","organizations_url":"https://api.github.com/users/kolloch/orgs","repos_url":"https://api.github.com/users/kolloch/repos","events_url":"https://api.github.com/users/kolloch/events{/privacy}","received_events_url":"https://api.github.com/users/kolloch/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T16:51:51Z","updated_at":"2015-10-15T16:51:51Z","body":"By the nature of distributed systems, you may always miss \"future\" events. Even without any caching.\r\n\r\nI like the idea of giving control to the user. We could provide a separate set of endpoints for service discovery that is cached."}}