{"action":"created","comment":{"url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/comments/192072521","pull_request_review_id":124772355,"id":192072521,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjA3MjUyMQ==","diff_hunk":"@@ -298,20 +304,24 @@ public override object Clone()\n             //  filterrate = pto->minFeeFilter;\n             //}\n \n-            List<TxMempoolInfo> sends = await this.manager.MempoolLock.WriteAsync(() =>\n+            var sends = new List<TxMempoolInfo>();\n+            lock (this.lockObject)","path":"src/Stratis.Bitcoin.Features.MemoryPool/MempoolBehavior.cs","position":39,"original_position":39,"commit_id":"9c3250241d70bec3a0abb37df4cc6e1e163770fa","original_commit_id":"9c3250241d70bec3a0abb37df4cc6e1e163770fa","user":{"login":"dangershony","id":7487930,"node_id":"MDQ6VXNlcjc0ODc5MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/7487930?v=4","gravatar_id":"","url":"https://api.github.com/users/dangershony","html_url":"https://github.com/dangershony","followers_url":"https://api.github.com/users/dangershony/followers","following_url":"https://api.github.com/users/dangershony/following{/other_user}","gists_url":"https://api.github.com/users/dangershony/gists{/gist_id}","starred_url":"https://api.github.com/users/dangershony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangershony/subscriptions","organizations_url":"https://api.github.com/users/dangershony/orgs","repos_url":"https://api.github.com/users/dangershony/repos","events_url":"https://api.github.com/users/dangershony/events{/privacy}","received_events_url":"https://api.github.com/users/dangershony/received_events","type":"User","site_admin":false},"body":"Perhaps this could be done with minimal time inside the lock?\r\nYou can do the logic in the foreach outside of the lock (say with local lists) and the also do the tracing, then inside the lock just copy/remove from the shared resource.","created_at":"2018-05-31T11:49:31Z","updated_at":"2018-05-31T11:49:31Z","html_url":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449#discussion_r192072521","pull_request_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/comments/192072521"},"html":{"href":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449#discussion_r192072521"},"pull_request":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449"}}},"pull_request":{"url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449","id":190163532,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwMTYzNTMy","html_url":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449","diff_url":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449.diff","patch_url":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449.patch","issue_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/1449","number":1449,"state":"open","locked":false,"title":"In mempool behaviour use own locks instead of mempool manager locks","user":{"login":"mikedennis","id":24234359,"node_id":"MDQ6VXNlcjI0MjM0MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/24234359?v=4","gravatar_id":"","url":"https://api.github.com/users/mikedennis","html_url":"https://github.com/mikedennis","followers_url":"https://api.github.com/users/mikedennis/followers","following_url":"https://api.github.com/users/mikedennis/following{/other_user}","gists_url":"https://api.github.com/users/mikedennis/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedennis/subscriptions","organizations_url":"https://api.github.com/users/mikedennis/orgs","repos_url":"https://api.github.com/users/mikedennis/repos","events_url":"https://api.github.com/users/mikedennis/events{/privacy}","received_events_url":"https://api.github.com/users/mikedennis/received_events","type":"User","site_admin":false},"body":"This PR addresses one of the issues in #1250 in regards to refactoring mempool behaviour to use it's own locks instead of relying on mempool manager locks. There is one occurrence that required leaving the mempool manager lock. Initially I tried removing it but that caused peers to be dropped, so it must be still required.\r\n \r\nThis PR also fixes the issue #1375 by actually adding the inventory items to the list of items that is sent.\r\n\r\nI have also improved logging support in mempool behaviour which I needed in order to troubleshoot this PR, as well as added some high level logging into mempool orphans.\r\n\r\nI tested this PR on both fully synced Bitcoin and Stratis Testnets by running the node fully synced for several hours with full mempool logging and examining the logs for any anomalies. Things appear to \r\nbehave as expected.\r\n\r\nIntegration and unit tests were also run with no new failures identified.","created_at":"2018-05-24T03:57:30Z","updated_at":"2018-05-31T11:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efe7148f34a8159ae2402c760a9c3b3bfcebb2b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":926800696,"node_id":"MDU6TGFiZWw5MjY4MDA2OTY=","url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/labels/pr-review-high","name":"pr-review-high","color":"0D2B50","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449/commits","review_comments_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449/comments","review_comment_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/1449/comments","statuses_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/statuses/9c3250241d70bec3a0abb37df4cc6e1e163770fa","head":{"label":"mikedennis:issue-1250","ref":"issue-1250","sha":"9c3250241d70bec3a0abb37df4cc6e1e163770fa","user":{"login":"mikedennis","id":24234359,"node_id":"MDQ6VXNlcjI0MjM0MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/24234359?v=4","gravatar_id":"","url":"https://api.github.com/users/mikedennis","html_url":"https://github.com/mikedennis","followers_url":"https://api.github.com/users/mikedennis/followers","following_url":"https://api.github.com/users/mikedennis/following{/other_user}","gists_url":"https://api.github.com/users/mikedennis/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedennis/subscriptions","organizations_url":"https://api.github.com/users/mikedennis/orgs","repos_url":"https://api.github.com/users/mikedennis/repos","events_url":"https://api.github.com/users/mikedennis/events{/privacy}","received_events_url":"https://api.github.com/users/mikedennis/received_events","type":"User","site_admin":false},"repo":{"id":96908927,"node_id":"MDEwOlJlcG9zaXRvcnk5NjkwODkyNw==","name":"StratisBitcoinFullNode","full_name":"mikedennis/StratisBitcoinFullNode","owner":{"login":"mikedennis","id":24234359,"node_id":"MDQ6VXNlcjI0MjM0MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/24234359?v=4","gravatar_id":"","url":"https://api.github.com/users/mikedennis","html_url":"https://github.com/mikedennis","followers_url":"https://api.github.com/users/mikedennis/followers","following_url":"https://api.github.com/users/mikedennis/following{/other_user}","gists_url":"https://api.github.com/users/mikedennis/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedennis/subscriptions","organizations_url":"https://api.github.com/users/mikedennis/orgs","repos_url":"https://api.github.com/users/mikedennis/repos","events_url":"https://api.github.com/users/mikedennis/events{/privacy}","received_events_url":"https://api.github.com/users/mikedennis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikedennis/StratisBitcoinFullNode","description":"Bitcoin full node in C#","fork":true,"url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode","forks_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/forks","keys_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/teams","hooks_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/hooks","issue_events_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/issues/events{/number}","events_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/events","assignees_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/assignees{/user}","branches_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/branches{/branch}","tags_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/tags","blobs_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/statuses/{sha}","languages_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/languages","stargazers_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/stargazers","contributors_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/contributors","subscribers_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/subscribers","subscription_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/subscription","commits_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/contents/{+path}","compare_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/merges","archive_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/downloads","issues_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/issues{/number}","pulls_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/pulls{/number}","milestones_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/milestones{/number}","notifications_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/labels{/name}","releases_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/releases{/id}","deployments_url":"https://api.github.com/repos/mikedennis/StratisBitcoinFullNode/deployments","created_at":"2017-07-11T15:32:38Z","updated_at":"2018-05-21T15:08:05Z","pushed_at":"2018-05-31T04:07:33Z","git_url":"git://github.com/mikedennis/StratisBitcoinFullNode.git","ssh_url":"git@github.com:mikedennis/StratisBitcoinFullNode.git","clone_url":"https://github.com/mikedennis/StratisBitcoinFullNode.git","svn_url":"https://github.com/mikedennis/StratisBitcoinFullNode","homepage":"https://stratisplatform.com","size":32368,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stratisproject:master","ref":"master","sha":"5d0136b1236283df9f32f4c302d97ca8aa0a8ee8","user":{"login":"stratisproject","id":15229748,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjI5NzQ4","avatar_url":"https://avatars0.githubusercontent.com/u/15229748?v=4","gravatar_id":"","url":"https://api.github.com/users/stratisproject","html_url":"https://github.com/stratisproject","followers_url":"https://api.github.com/users/stratisproject/followers","following_url":"https://api.github.com/users/stratisproject/following{/other_user}","gists_url":"https://api.github.com/users/stratisproject/gists{/gist_id}","starred_url":"https://api.github.com/users/stratisproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratisproject/subscriptions","organizations_url":"https://api.github.com/users/stratisproject/orgs","repos_url":"https://api.github.com/users/stratisproject/repos","events_url":"https://api.github.com/users/stratisproject/events{/privacy}","received_events_url":"https://api.github.com/users/stratisproject/received_events","type":"Organization","site_admin":false},"repo":{"id":67271290,"node_id":"MDEwOlJlcG9zaXRvcnk2NzI3MTI5MA==","name":"StratisBitcoinFullNode","full_name":"stratisproject/StratisBitcoinFullNode","owner":{"login":"stratisproject","id":15229748,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjI5NzQ4","avatar_url":"https://avatars0.githubusercontent.com/u/15229748?v=4","gravatar_id":"","url":"https://api.github.com/users/stratisproject","html_url":"https://github.com/stratisproject","followers_url":"https://api.github.com/users/stratisproject/followers","following_url":"https://api.github.com/users/stratisproject/following{/other_user}","gists_url":"https://api.github.com/users/stratisproject/gists{/gist_id}","starred_url":"https://api.github.com/users/stratisproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratisproject/subscriptions","organizations_url":"https://api.github.com/users/stratisproject/orgs","repos_url":"https://api.github.com/users/stratisproject/repos","events_url":"https://api.github.com/users/stratisproject/events{/privacy}","received_events_url":"https://api.github.com/users/stratisproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stratisproject/StratisBitcoinFullNode","description":"Bitcoin full node in C#","fork":false,"url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode","forks_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/forks","keys_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/teams","hooks_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/hooks","issue_events_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/events{/number}","events_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/events","assignees_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/assignees{/user}","branches_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/branches{/branch}","tags_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/tags","blobs_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/git/refs{/sha}","trees_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/statuses/{sha}","languages_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/languages","stargazers_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/stargazers","contributors_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/contributors","subscribers_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/subscribers","subscription_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/subscription","commits_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/commits{/sha}","git_commits_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/git/commits{/sha}","comments_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/comments{/number}","issue_comment_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/comments{/number}","contents_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/contents/{+path}","compare_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/merges","archive_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/downloads","issues_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues{/number}","pulls_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls{/number}","milestones_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/milestones{/number}","notifications_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/labels{/name}","releases_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/releases{/id}","deployments_url":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/deployments","created_at":"2016-09-03T04:32:51Z","updated_at":"2018-05-31T08:49:31Z","pushed_at":"2018-05-31T11:44:27Z","git_url":"git://github.com/stratisproject/StratisBitcoinFullNode.git","ssh_url":"git@github.com:stratisproject/StratisBitcoinFullNode.git","clone_url":"https://github.com/stratisproject/StratisBitcoinFullNode.git","svn_url":"https://github.com/stratisproject/StratisBitcoinFullNode","homepage":"https://stratisplatform.com","size":29258,"stargazers_count":480,"watchers_count":480,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":208,"mirror_url":null,"archived":false,"open_issues_count":105,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":208,"open_issues":105,"watchers":480,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449"},"html":{"href":"https://github.com/stratisproject/StratisBitcoinFullNode/pull/1449"},"issue":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/1449"},"comments":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/issues/1449/comments"},"review_comments":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449/comments"},"review_comment":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/pulls/1449/commits"},"statuses":{"href":"https://api.github.com/repos/stratisproject/StratisBitcoinFullNode/statuses/9c3250241d70bec3a0abb37df4cc6e1e163770fa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dangershony"}}