{"action":"created","issue":{"url":"https://api.github.com/repos/ensime/ensime-server/issues/1436","repository_url":"https://api.github.com/repos/ensime/ensime-server","labels_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/labels{/name}","comments_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/comments","events_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/events","html_url":"https://github.com/ensime/ensime-server/pull/1436","id":152469457,"number":1436,"title":"WIP reduce memory pressure during SearchService.refresh","user":{"login":"ChrisCoffey","id":5373301,"avatar_url":"https://avatars.githubusercontent.com/u/5373301?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisCoffey","html_url":"https://github.com/ChrisCoffey","followers_url":"https://api.github.com/users/ChrisCoffey/followers","following_url":"https://api.github.com/users/ChrisCoffey/following{/other_user}","gists_url":"https://api.github.com/users/ChrisCoffey/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisCoffey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisCoffey/subscriptions","organizations_url":"https://api.github.com/users/ChrisCoffey/orgs","repos_url":"https://api.github.com/users/ChrisCoffey/repos","events_url":"https://api.github.com/users/ChrisCoffey/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisCoffey/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ensime/ensime-server/labels/Needs%20Review","name":"Needs Review","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-02T01:40:46Z","updated_at":"2016-05-02T14:14:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ensime/ensime-server/pulls/1436","html_url":"https://github.com/ensime/ensime-server/pull/1436","diff_url":"https://github.com/ensime/ensime-server/pull/1436.diff","patch_url":"https://github.com/ensime/ensime-server/pull/1436.patch"},"body":"This is still under construction, but there are a couple of approaches I've considered for #1341\r\n\r\n- Synchronize the refresh flow as much as possible. Certainly introduces \"backpressure\", but it also feels like we're loosing out on some parallelism here\r\n- Use a bounded queue & `CallerRunsPolicy` once the queue is full. With a queue of size one, this means we'll begin using the calling thread for overflow work, which in turn slows down the caller, applying some back pressure\r\n- Introduce a custom `RejectedExecutionHandler` policy that actually blocks the caller rather than delegate work to it. This seems like overkill for what we need.\r\n\r\nI toyed around with the 3rd option, but ended up settling on the `CallerRunsPolicy` approach. I want to make sure this passes tests up here, and in the meantime I'll remove the old `val handler`. "},"comment":{"url":"https://api.github.com/repos/ensime/ensime-server/issues/comments/216246726","html_url":"https://github.com/ensime/ensime-server/pull/1436#issuecomment-216246726","issue_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436","id":216246726,"user":{"login":"ChrisCoffey","id":5373301,"avatar_url":"https://avatars.githubusercontent.com/u/5373301?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisCoffey","html_url":"https://github.com/ChrisCoffey","followers_url":"https://api.github.com/users/ChrisCoffey/followers","following_url":"https://api.github.com/users/ChrisCoffey/following{/other_user}","gists_url":"https://api.github.com/users/ChrisCoffey/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisCoffey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisCoffey/subscriptions","organizations_url":"https://api.github.com/users/ChrisCoffey/orgs","repos_url":"https://api.github.com/users/ChrisCoffey/repos","events_url":"https://api.github.com/users/ChrisCoffey/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisCoffey/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T14:14:35Z","updated_at":"2016-05-02T14:14:35Z","body":"Haha, true about all of the options. I'm hoping to avoid major surgery though 😄 "}}