{"action":"created","comment":{"url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/comments/330287697","pull_request_review_id":295909013,"id":330287697,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMDI4NzY5Nw==","diff_hunk":"@@ -87,50 +91,40 @@ class GossipServiceServer[F[_]: Concurrent: Par: Log: Metrics](\n       source: Node,\n       newBlockHashes: Set[ByteString],\n       skipRelaying: Boolean\n-  ): F[Either[SyncError, Unit]] = {\n-    def logSyncError(syncError: SyncError): F[Unit] = {\n+  ): F[Either[SyncError, Vector[WaitHandle[F]]]] = {","path":"comm/src/main/scala/io/casperlabs/comm/gossiping/GossipServiceServer.scala","position":58,"original_position":49,"commit_id":"90fba209d099d6f05d84a7b8d4a8d7713f255c5a","original_commit_id":"de9ac8ef6c39244a50b6aeb7d5c77de64502db2a","user":{"login":"aakoshh","id":2684603,"node_id":"MDQ6VXNlcjI2ODQ2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684603?v=4","gravatar_id":"","url":"https://api.github.com/users/aakoshh","html_url":"https://github.com/aakoshh","followers_url":"https://api.github.com/users/aakoshh/followers","following_url":"https://api.github.com/users/aakoshh/following{/other_user}","gists_url":"https://api.github.com/users/aakoshh/gists{/gist_id}","starred_url":"https://api.github.com/users/aakoshh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aakoshh/subscriptions","organizations_url":"https://api.github.com/users/aakoshh/orgs","repos_url":"https://api.github.com/users/aakoshh/repos","events_url":"https://api.github.com/users/aakoshh/events{/privacy}","received_events_url":"https://api.github.com/users/aakoshh/received_events","type":"User","site_admin":false},"body":"Thanks, fixed.","created_at":"2019-10-01T21:36:47Z","updated_at":"2019-10-01T21:36:47Z","html_url":"https://github.com/CasperLabs/CasperLabs/pull/1189#discussion_r330287697","pull_request_url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/comments/330287697"},"html":{"href":"https://github.com/CasperLabs/CasperLabs/pull/1189#discussion_r330287697"},"pull_request":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189"}},"in_reply_to_id":330241900},"pull_request":{"url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189","id":323409370,"node_id":"MDExOlB1bGxSZXF1ZXN0MzIzNDA5Mzcw","html_url":"https://github.com/CasperLabs/CasperLabs/pull/1189","diff_url":"https://github.com/CasperLabs/CasperLabs/pull/1189.diff","patch_url":"https://github.com/CasperLabs/CasperLabs/pull/1189.patch","issue_url":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/1189","number":1189,"state":"open","locked":false,"title":"NODE-926: Fix DownloadManager memory leak","user":{"login":"aakoshh","id":2684603,"node_id":"MDQ6VXNlcjI2ODQ2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684603?v=4","gravatar_id":"","url":"https://api.github.com/users/aakoshh","html_url":"https://github.com/aakoshh","followers_url":"https://api.github.com/users/aakoshh/followers","following_url":"https://api.github.com/users/aakoshh/following{/other_user}","gists_url":"https://api.github.com/users/aakoshh/gists{/gist_id}","starred_url":"https://api.github.com/users/aakoshh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aakoshh/subscriptions","organizations_url":"https://api.github.com/users/aakoshh/orgs","repos_url":"https://api.github.com/users/aakoshh/repos","events_url":"https://api.github.com/users/aakoshh/events{/privacy}","received_events_url":"https://api.github.com/users/aakoshh/received_events","type":"User","site_admin":false},"body":"### Overview\r\nEvery time the node synchronized with another one after it has been notified about a block in `GossipServiceServer`, it scheduled every `BlockSummary` in the missing DAG to be downloaded and attached callbacks to when the downloads finished. The closure of that callback held a reference to the full summaries, which were identical but different instances then on previous schedules. When the downloads didn't happen because the node got slow, this data kept accumulating in memory. \r\n\r\nThe PR rerranges things so that the callbacks are not necessary, the `DownloadManager` will do the notifications itself. This has the benefit that they will only be called once. There will also only be at most one `Deferred` per download item, not an ever longer list as it's scheduled more and more.\r\n\r\n### Which JIRA ticket does this PR relate to?\r\nhttps://casperlabs.atlassian.net/browse/NODE-926\r\n\r\n### Complete this checklist before you submit this PR\r\n- [x] This PR contains no more than 200 lines of code, excluding test code.\r\n- [x] This PR meets [CasperLabs coding standards](https://casperlabs.atlassian.net/wiki/spaces/EN/pages/16842753/Coding+Standards).\r\n- [x] If this PR adds a new feature, it includes tests related to this feature.\r\n- [x] You assigned one person to review this PR.\r\n- [x] Your GitHub account is linked with our [Drone CI](https://drone-auto.casperlabs.io/) system. This is necessary to run tests on this PR.\r\n\r\n### Notes\r\n_Optional. Add any notes on caveats, approaches you tried that didn't work, or anything else._\r\n","created_at":"2019-10-01T18:19:01Z","updated_at":"2019-10-01T21:36:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59c32eca83c04ef1e9f65b33f2cdc1a9f8b2c113","assignee":null,"assignees":[],"requested_reviewers":[{"login":"goral09","id":5120801,"node_id":"MDQ6VXNlcjUxMjA4MDE=","avatar_url":"https://avatars2.githubusercontent.com/u/5120801?v=4","gravatar_id":"","url":"https://api.github.com/users/goral09","html_url":"https://github.com/goral09","followers_url":"https://api.github.com/users/goral09/followers","following_url":"https://api.github.com/users/goral09/following{/other_user}","gists_url":"https://api.github.com/users/goral09/gists{/gist_id}","starred_url":"https://api.github.com/users/goral09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goral09/subscriptions","organizations_url":"https://api.github.com/users/goral09/orgs","repos_url":"https://api.github.com/users/goral09/repos","events_url":"https://api.github.com/users/goral09/events{/privacy}","received_events_url":"https://api.github.com/users/goral09/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189/commits","review_comments_url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189/comments","review_comment_url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/1189/comments","statuses_url":"https://api.github.com/repos/CasperLabs/CasperLabs/statuses/90fba209d099d6f05d84a7b8d4a8d7713f255c5a","head":{"label":"aakoshh:NODE-926-fix-download-manager-memory-leak","ref":"NODE-926-fix-download-manager-memory-leak","sha":"90fba209d099d6f05d84a7b8d4a8d7713f255c5a","user":{"login":"aakoshh","id":2684603,"node_id":"MDQ6VXNlcjI2ODQ2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684603?v=4","gravatar_id":"","url":"https://api.github.com/users/aakoshh","html_url":"https://github.com/aakoshh","followers_url":"https://api.github.com/users/aakoshh/followers","following_url":"https://api.github.com/users/aakoshh/following{/other_user}","gists_url":"https://api.github.com/users/aakoshh/gists{/gist_id}","starred_url":"https://api.github.com/users/aakoshh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aakoshh/subscriptions","organizations_url":"https://api.github.com/users/aakoshh/orgs","repos_url":"https://api.github.com/users/aakoshh/repos","events_url":"https://api.github.com/users/aakoshh/events{/privacy}","received_events_url":"https://api.github.com/users/aakoshh/received_events","type":"User","site_admin":false},"repo":{"id":172880886,"node_id":"MDEwOlJlcG9zaXRvcnkxNzI4ODA4ODY=","name":"CasperLabs","full_name":"aakoshh/CasperLabs","private":false,"owner":{"login":"aakoshh","id":2684603,"node_id":"MDQ6VXNlcjI2ODQ2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684603?v=4","gravatar_id":"","url":"https://api.github.com/users/aakoshh","html_url":"https://github.com/aakoshh","followers_url":"https://api.github.com/users/aakoshh/followers","following_url":"https://api.github.com/users/aakoshh/following{/other_user}","gists_url":"https://api.github.com/users/aakoshh/gists{/gist_id}","starred_url":"https://api.github.com/users/aakoshh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aakoshh/subscriptions","organizations_url":"https://api.github.com/users/aakoshh/orgs","repos_url":"https://api.github.com/users/aakoshh/repos","events_url":"https://api.github.com/users/aakoshh/events{/privacy}","received_events_url":"https://api.github.com/users/aakoshh/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aakoshh/CasperLabs","description":null,"fork":true,"url":"https://api.github.com/repos/aakoshh/CasperLabs","forks_url":"https://api.github.com/repos/aakoshh/CasperLabs/forks","keys_url":"https://api.github.com/repos/aakoshh/CasperLabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aakoshh/CasperLabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aakoshh/CasperLabs/teams","hooks_url":"https://api.github.com/repos/aakoshh/CasperLabs/hooks","issue_events_url":"https://api.github.com/repos/aakoshh/CasperLabs/issues/events{/number}","events_url":"https://api.github.com/repos/aakoshh/CasperLabs/events","assignees_url":"https://api.github.com/repos/aakoshh/CasperLabs/assignees{/user}","branches_url":"https://api.github.com/repos/aakoshh/CasperLabs/branches{/branch}","tags_url":"https://api.github.com/repos/aakoshh/CasperLabs/tags","blobs_url":"https://api.github.com/repos/aakoshh/CasperLabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aakoshh/CasperLabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aakoshh/CasperLabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aakoshh/CasperLabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aakoshh/CasperLabs/statuses/{sha}","languages_url":"https://api.github.com/repos/aakoshh/CasperLabs/languages","stargazers_url":"https://api.github.com/repos/aakoshh/CasperLabs/stargazers","contributors_url":"https://api.github.com/repos/aakoshh/CasperLabs/contributors","subscribers_url":"https://api.github.com/repos/aakoshh/CasperLabs/subscribers","subscription_url":"https://api.github.com/repos/aakoshh/CasperLabs/subscription","commits_url":"https://api.github.com/repos/aakoshh/CasperLabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aakoshh/CasperLabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aakoshh/CasperLabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aakoshh/CasperLabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aakoshh/CasperLabs/contents/{+path}","compare_url":"https://api.github.com/repos/aakoshh/CasperLabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aakoshh/CasperLabs/merges","archive_url":"https://api.github.com/repos/aakoshh/CasperLabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aakoshh/CasperLabs/downloads","issues_url":"https://api.github.com/repos/aakoshh/CasperLabs/issues{/number}","pulls_url":"https://api.github.com/repos/aakoshh/CasperLabs/pulls{/number}","milestones_url":"https://api.github.com/repos/aakoshh/CasperLabs/milestones{/number}","notifications_url":"https://api.github.com/repos/aakoshh/CasperLabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aakoshh/CasperLabs/labels{/name}","releases_url":"https://api.github.com/repos/aakoshh/CasperLabs/releases{/id}","deployments_url":"https://api.github.com/repos/aakoshh/CasperLabs/deployments","created_at":"2019-02-27T09:04:37Z","updated_at":"2019-09-13T09:48:18Z","pushed_at":"2019-10-01T21:35:33Z","git_url":"git://github.com/aakoshh/CasperLabs.git","ssh_url":"git@github.com:aakoshh/CasperLabs.git","clone_url":"https://github.com/aakoshh/CasperLabs.git","svn_url":"https://github.com/aakoshh/CasperLabs","homepage":null,"size":19707,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"dev"}},"base":{"label":"CasperLabs:NODE-659-rdbms-epic","ref":"NODE-659-rdbms-epic","sha":"fd9556387d98a93dc2410b098b44fdbe69b75916","user":{"login":"CasperLabs","id":44785362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0Nzg1MzYy","avatar_url":"https://avatars0.githubusercontent.com/u/44785362?v=4","gravatar_id":"","url":"https://api.github.com/users/CasperLabs","html_url":"https://github.com/CasperLabs","followers_url":"https://api.github.com/users/CasperLabs/followers","following_url":"https://api.github.com/users/CasperLabs/following{/other_user}","gists_url":"https://api.github.com/users/CasperLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CasperLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CasperLabs/subscriptions","organizations_url":"https://api.github.com/users/CasperLabs/orgs","repos_url":"https://api.github.com/users/CasperLabs/repos","events_url":"https://api.github.com/users/CasperLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CasperLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":160243933,"node_id":"MDEwOlJlcG9zaXRvcnkxNjAyNDM5MzM=","name":"CasperLabs","full_name":"CasperLabs/CasperLabs","private":false,"owner":{"login":"CasperLabs","id":44785362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0Nzg1MzYy","avatar_url":"https://avatars0.githubusercontent.com/u/44785362?v=4","gravatar_id":"","url":"https://api.github.com/users/CasperLabs","html_url":"https://github.com/CasperLabs","followers_url":"https://api.github.com/users/CasperLabs/followers","following_url":"https://api.github.com/users/CasperLabs/following{/other_user}","gists_url":"https://api.github.com/users/CasperLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CasperLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CasperLabs/subscriptions","organizations_url":"https://api.github.com/users/CasperLabs/orgs","repos_url":"https://api.github.com/users/CasperLabs/repos","events_url":"https://api.github.com/users/CasperLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CasperLabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CasperLabs/CasperLabs","description":"CasperLabs Core","fork":false,"url":"https://api.github.com/repos/CasperLabs/CasperLabs","forks_url":"https://api.github.com/repos/CasperLabs/CasperLabs/forks","keys_url":"https://api.github.com/repos/CasperLabs/CasperLabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CasperLabs/CasperLabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CasperLabs/CasperLabs/teams","hooks_url":"https://api.github.com/repos/CasperLabs/CasperLabs/hooks","issue_events_url":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/events{/number}","events_url":"https://api.github.com/repos/CasperLabs/CasperLabs/events","assignees_url":"https://api.github.com/repos/CasperLabs/CasperLabs/assignees{/user}","branches_url":"https://api.github.com/repos/CasperLabs/CasperLabs/branches{/branch}","tags_url":"https://api.github.com/repos/CasperLabs/CasperLabs/tags","blobs_url":"https://api.github.com/repos/CasperLabs/CasperLabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CasperLabs/CasperLabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CasperLabs/CasperLabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/CasperLabs/CasperLabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CasperLabs/CasperLabs/statuses/{sha}","languages_url":"https://api.github.com/repos/CasperLabs/CasperLabs/languages","stargazers_url":"https://api.github.com/repos/CasperLabs/CasperLabs/stargazers","contributors_url":"https://api.github.com/repos/CasperLabs/CasperLabs/contributors","subscribers_url":"https://api.github.com/repos/CasperLabs/CasperLabs/subscribers","subscription_url":"https://api.github.com/repos/CasperLabs/CasperLabs/subscription","commits_url":"https://api.github.com/repos/CasperLabs/CasperLabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/CasperLabs/CasperLabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/CasperLabs/CasperLabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/CasperLabs/CasperLabs/contents/{+path}","compare_url":"https://api.github.com/repos/CasperLabs/CasperLabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CasperLabs/CasperLabs/merges","archive_url":"https://api.github.com/repos/CasperLabs/CasperLabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CasperLabs/CasperLabs/downloads","issues_url":"https://api.github.com/repos/CasperLabs/CasperLabs/issues{/number}","pulls_url":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls{/number}","milestones_url":"https://api.github.com/repos/CasperLabs/CasperLabs/milestones{/number}","notifications_url":"https://api.github.com/repos/CasperLabs/CasperLabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CasperLabs/CasperLabs/labels{/name}","releases_url":"https://api.github.com/repos/CasperLabs/CasperLabs/releases{/id}","deployments_url":"https://api.github.com/repos/CasperLabs/CasperLabs/deployments","created_at":"2018-12-03T19:39:20Z","updated_at":"2019-10-01T19:54:42Z","pushed_at":"2019-10-01T21:35:35Z","git_url":"git://github.com/CasperLabs/CasperLabs.git","ssh_url":"git@github.com:CasperLabs/CasperLabs.git","clone_url":"https://github.com/CasperLabs/CasperLabs.git","svn_url":"https://github.com/CasperLabs/CasperLabs","homepage":"","size":20078,"stargazers_count":62,"watchers_count":62,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":16,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":32,"open_issues":16,"watchers":62,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189"},"html":{"href":"https://github.com/CasperLabs/CasperLabs/pull/1189"},"issue":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/1189"},"comments":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/issues/1189/comments"},"review_comments":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189/comments"},"review_comment":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/pulls/1189/commits"},"statuses":{"href":"https://api.github.com/repos/CasperLabs/CasperLabs/statuses/90fba209d099d6f05d84a7b8d4a8d7713f255c5a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aakoshh"}}