{"action":"created","issue":{"url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/168","labels_url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/168/comments","events_url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/168/events","html_url":"https://github.com/bazaarvoice/ostrich/pull/168","id":57969864,"number":168,"title":"first pass at creating MultiThreadedClientServiceCache","user":{"login":"bivasdas","id":5587198,"avatar_url":"https://avatars.githubusercontent.com/u/5587198?v=3","gravatar_id":"","url":"https://api.github.com/users/bivasdas","html_url":"https://github.com/bivasdas","followers_url":"https://api.github.com/users/bivasdas/followers","following_url":"https://api.github.com/users/bivasdas/following{/other_user}","gists_url":"https://api.github.com/users/bivasdas/gists{/gist_id}","starred_url":"https://api.github.com/users/bivasdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bivasdas/subscriptions","organizations_url":"https://api.github.com/users/bivasdas/orgs","repos_url":"https://api.github.com/users/bivasdas/repos","events_url":"https://api.github.com/users/bivasdas/events{/privacy}","received_events_url":"https://api.github.com/users/bivasdas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-17T19:29:20Z","updated_at":"2015-02-20T01:08:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bazaarvoice/ostrich/pulls/168","html_url":"https://github.com/bazaarvoice/ostrich/pull/168","diff_url":"https://github.com/bazaarvoice/ostrich/pull/168.diff","patch_url":"https://github.com/bazaarvoice/ostrich/pull/168.patch"},"body":"This mimics a service cache that maintains a map of singleton service handles per endpoint, and eliminates the need for the cache checkout/checkin altogether."},"comment":{"url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/comments/75172567","html_url":"https://github.com/bazaarvoice/ostrich/pull/168#issuecomment-75172567","issue_url":"https://api.github.com/repos/bazaarvoice/ostrich/issues/168","id":75172567,"user":{"login":"ohhatiya","id":1205560,"avatar_url":"https://avatars.githubusercontent.com/u/1205560?v=3","gravatar_id":"","url":"https://api.github.com/users/ohhatiya","html_url":"https://github.com/ohhatiya","followers_url":"https://api.github.com/users/ohhatiya/followers","following_url":"https://api.github.com/users/ohhatiya/following{/other_user}","gists_url":"https://api.github.com/users/ohhatiya/gists{/gist_id}","starred_url":"https://api.github.com/users/ohhatiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohhatiya/subscriptions","organizations_url":"https://api.github.com/users/ohhatiya/orgs","repos_url":"https://api.github.com/users/ohhatiya/repos","events_url":"https://api.github.com/users/ohhatiya/events{/privacy}","received_events_url":"https://api.github.com/users/ohhatiya/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T01:08:11Z","updated_at":"2015-02-20T01:08:11Z","body":"So, there are unfortunately a couple assumptions the current version of this pull request makes that aren't valid.\r\n\r\n1. That `checkOut` will not be called for an end point until `register` has finished executing. Right now at least the `ZooKeeperHostDiscovery` adds an end point to its local set before notifying its listeners. So the `ServicePool` could try to use an end point that has not registered yet. I don't think the ordering of listeners being notified and end points showing up in `getHosts` calls is currently part of our API contract, so we could potentially change our implementation. Otherwise we'll have to rethink the register strategy.\r\n2. That `checkOut` will not be called for an end point after it is evicted. The `ServicePool` will evict from the cache end points that it has failed to execute against. However, if those end points then pass health checks, it will start to use them again. The new cache will need some way to deal with that."}}