{"action":"created","issue":{"url":"https://api.github.com/repos/novoda/download-manager/issues/130","labels_url":"https://api.github.com/repos/novoda/download-manager/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/novoda/download-manager/issues/130/comments","events_url":"https://api.github.com/repos/novoda/download-manager/issues/130/events","html_url":"https://github.com/novoda/download-manager/pull/130","id":96804985,"number":130,"title":"Fix concurrent downloads and memory leaks","user":{"login":"amlcurran","id":666285,"avatar_url":"https://avatars.githubusercontent.com/u/666285?v=3","gravatar_id":"","url":"https://api.github.com/users/amlcurran","html_url":"https://github.com/amlcurran","followers_url":"https://api.github.com/users/amlcurran/followers","following_url":"https://api.github.com/users/amlcurran/following{/other_user}","gists_url":"https://api.github.com/users/amlcurran/gists{/gist_id}","starred_url":"https://api.github.com/users/amlcurran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amlcurran/subscriptions","organizations_url":"https://api.github.com/users/amlcurran/orgs","repos_url":"https://api.github.com/users/amlcurran/repos","events_url":"https://api.github.com/users/amlcurran/events{/privacy}","received_events_url":"https://api.github.com/users/amlcurran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-23T12:43:50Z","updated_at":"2015-07-23T14:20:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/130","html_url":"https://github.com/novoda/download-manager/pull/130","diff_url":"https://github.com/novoda/download-manager/pull/130.diff","patch_url":"https://github.com/novoda/download-manager/pull/130.patch"},"body":"An issue was occurring where pausing three downloads and quickly resuming them again resulting in two downloads at the same time (if the limit was one download at a time).\r\n\r\nIt was determined that the service would shut down but the executor free to continue downloading (which it did), and then resuming another download triggered another service with a *different* executor.\r\n\r\nThe fix is to force shutting down the executor when the service stops.\r\n\r\nAlso, we now check the pause state at the beginning of the download task because it wouldn't actually pause until it had downloaded the first 4KB.\r\n\r\nI have also made some changes that @zegnus made in his PR #128 as these were blocking me too"},"comment":{"url":"https://api.github.com/repos/novoda/download-manager/issues/comments/124121906","html_url":"https://github.com/novoda/download-manager/pull/130#issuecomment-124121906","issue_url":"https://api.github.com/repos/novoda/download-manager/issues/130","id":124121906,"user":{"login":"hal9002","id":2164980,"avatar_url":"https://avatars.githubusercontent.com/u/2164980?v=3","gravatar_id":"","url":"https://api.github.com/users/hal9002","html_url":"https://github.com/hal9002","followers_url":"https://api.github.com/users/hal9002/followers","following_url":"https://api.github.com/users/hal9002/following{/other_user}","gists_url":"https://api.github.com/users/hal9002/gists{/gist_id}","starred_url":"https://api.github.com/users/hal9002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hal9002/subscriptions","organizations_url":"https://api.github.com/users/hal9002/orgs","repos_url":"https://api.github.com/users/hal9002/repos","events_url":"https://api.github.com/users/hal9002/events{/privacy}","received_events_url":"https://api.github.com/users/hal9002/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T14:20:03Z","updated_at":"2015-07-23T14:20:03Z","body":"\nRefer to this link for build results (access rights to CI server needed): \nhttps://ci.novoda.com/job/download-manager-prb/175/\nTest PASSed."}}