{"action":"created","issue":{"url":"https://api.github.com/repos/typelead/eta/issues/847","repository_url":"https://api.github.com/repos/typelead/eta","labels_url":"https://api.github.com/repos/typelead/eta/issues/847/labels{/name}","comments_url":"https://api.github.com/repos/typelead/eta/issues/847/comments","events_url":"https://api.github.com/repos/typelead/eta/issues/847/events","html_url":"https://github.com/typelead/eta/pull/847","id":350878751,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NjE0ODUx","number":847,"title":"exponential backoff implementation to avoid over-polling resources","user":{"login":"shirouto","id":28932673,"node_id":"MDQ6VXNlcjI4OTMyNjcz","avatar_url":"https://avatars2.githubusercontent.com/u/28932673?v=4","gravatar_id":"","url":"https://api.github.com/users/shirouto","html_url":"https://github.com/shirouto","followers_url":"https://api.github.com/users/shirouto/followers","following_url":"https://api.github.com/users/shirouto/following{/other_user}","gists_url":"https://api.github.com/users/shirouto/gists{/gist_id}","starred_url":"https://api.github.com/users/shirouto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirouto/subscriptions","organizations_url":"https://api.github.com/users/shirouto/orgs","repos_url":"https://api.github.com/users/shirouto/repos","events_url":"https://api.github.com/users/shirouto/events{/privacy}","received_events_url":"https://api.github.com/users/shirouto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-15T16:36:00Z","updated_at":"2018-08-17T14:42:50Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/typelead/eta/pulls/847","html_url":"https://github.com/typelead/eta/pull/847","diff_url":"https://github.com/typelead/eta/pull/847.diff","patch_url":"https://github.com/typelead/eta/pull/847.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\nVery naive implementation of exponential backoff to mitigate the overpolling of resources in the RTS.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\nVery rudimentary testing, mainly to check whether the approach does improve the Warp IO issues and overusing of the CPU cores. This is an experiment and definitely a WIP.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n- [ ] Documentation change\r\n- [ ] Test suite change\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I have read the **CONTRIBUTING** document.\r\n"},"comment":{"url":"https://api.github.com/repos/typelead/eta/issues/comments/413888089","html_url":"https://github.com/typelead/eta/pull/847#issuecomment-413888089","issue_url":"https://api.github.com/repos/typelead/eta/issues/847","id":413888089,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzg4ODA4OQ==","user":{"login":"rahulmutt","id":8035100,"node_id":"MDQ6VXNlcjgwMzUxMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/8035100?v=4","gravatar_id":"","url":"https://api.github.com/users/rahulmutt","html_url":"https://github.com/rahulmutt","followers_url":"https://api.github.com/users/rahulmutt/followers","following_url":"https://api.github.com/users/rahulmutt/following{/other_user}","gists_url":"https://api.github.com/users/rahulmutt/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulmutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulmutt/subscriptions","organizations_url":"https://api.github.com/users/rahulmutt/orgs","repos_url":"https://api.github.com/users/rahulmutt/repos","events_url":"https://api.github.com/users/rahulmutt/events{/privacy}","received_events_url":"https://api.github.com/users/rahulmutt/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T14:42:50Z","updated_at":"2018-08-17T14:42:50Z","author_association":"MEMBER","body":"@shirouto Thank you so much for taking the time to implement this. I have spent a while thinking about this and the root problem is that we do too much polling and we shouldn't be. I went through all our uses of polling and a majority of them can be avoided and use instead Java's efficient built-in mechanisms like Object.wait() and Object.notify() for signaling. Now there are a couple of use cases that absolutely require polling (like for `waitFuture`) since they don't have support from the JVM to do otherwise and in that case I think the best way to go is to just allocate a dedicated thread that does the polling with some exponential backoff.\r\n\r\nThese changes will take time since there are a lot of moving parts and room for error, so we'll tackle these one-by-one after we have a more comprehensive test suite (the current one has very few tests that test the concurrent aspects of the runtime). \r\n\r\nIn the meantime, I think we can use your exponential backoff changes. Overall, it looks ok.\r\n\r\nI just think we need to add a couple tests to make sure they don't break anything. You can add tests in `tests/suite/*` (just follow the convention). You can run the test suite like this:\r\n\r\n```\r\nstack build eta-test-suite && stack exec eta-test-suite -- -p [test-suite-name]\r\n```\r\n\r\nSay you great a new folder in `tests/suite/backoff` and want to run just the tests inside - you can replace `[test-suite-name]` with `backoff`. Let me know if you need anymore help with adding new tests.\r\n"}}
{"actor":{"display_login":"rahulmutt"}}