{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/7","labels_url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/7/comments","events_url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/7/events","html_url":"https://github.com/cloudfoundry/storeadapter/issues/7","id":87103902,"number":7,"title":"Etcd Watch does not pass in a channel to etcd.Client.Watch()","user":{"login":"crhino","id":4146455,"avatar_url":"https://avatars.githubusercontent.com/u/4146455?v=3","gravatar_id":"","url":"https://api.github.com/users/crhino","html_url":"https://github.com/crhino","followers_url":"https://api.github.com/users/crhino/followers","following_url":"https://api.github.com/users/crhino/following{/other_user}","gists_url":"https://api.github.com/users/crhino/gists{/gist_id}","starred_url":"https://api.github.com/users/crhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhino/subscriptions","organizations_url":"https://api.github.com/users/crhino/orgs","repos_url":"https://api.github.com/users/crhino/repos","events_url":"https://api.github.com/users/crhino/events{/privacy}","received_events_url":"https://api.github.com/users/crhino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-10T20:53:23Z","updated_at":"2015-06-10T23:07:19Z","closed_at":null,"body":"Doing some performance testing on the new CF Routing API, we found that under high load (~200 concurrent requests), the Watch function was missing a large amount of events. This translated into a long wait time for propagating routes from the API to the GoRouter. We spiked on adding a channel to the call and it improved performance dramatically.\r\n\r\nIs there a reason why the current implementation does not use a channel to receive events from the etcd client?\r\n\r\n\r\n@crhino && @ebabani"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/comments/110942627","html_url":"https://github.com/cloudfoundry/storeadapter/issues/7#issuecomment-110942627","issue_url":"https://api.github.com/repos/cloudfoundry/storeadapter/issues/7","id":110942627,"user":{"login":"crhino","id":4146455,"avatar_url":"https://avatars.githubusercontent.com/u/4146455?v=3","gravatar_id":"","url":"https://api.github.com/users/crhino","html_url":"https://github.com/crhino","followers_url":"https://api.github.com/users/crhino/followers","following_url":"https://api.github.com/users/crhino/following{/other_user}","gists_url":"https://api.github.com/users/crhino/gists{/gist_id}","starred_url":"https://api.github.com/users/crhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhino/subscriptions","organizations_url":"https://api.github.com/users/crhino/orgs","repos_url":"https://api.github.com/users/crhino/repos","events_url":"https://api.github.com/users/crhino/events{/privacy}","received_events_url":"https://api.github.com/users/crhino/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T23:07:19Z","updated_at":"2015-06-10T23:07:19Z","body":"https://gist.github.com/crhino/96f2b76bc275b7726671\r\n\r\nThat is a diff of our changes for the spike. We tried to preserve the same behavior, although two tests were failing.\r\n```\r\nIt(\"skips the missing event history and eventually catches up\"\r\nIt(\"should write to the error channel\"\r\n```\r\n\r\nThe error channel  failure was because the etcd.client.Watch() closes the recvChan as well as returning an error, so there was a race condition about which case of the select statement would be triggered. The missing events history seems more relevant."}}