{"action":"created","comment":{"url":"https://api.github.com/repos/monetas/bmd/pulls/comments/35724327","id":35724327,"diff_hunk":"@@ -43,6 +43,10 @@ const (\n \t// connectionRetryInterval is the amount of time to wait in between\n \t// retries when connecting to persistent peers.\n \tconnectionRetryInterval = time.Second * 10\n+\n+\t// maxReconnectionAttempts is the maximum number of reconnection attempts\n+\t// allowed before a persistant peer is dropped.\n+\tmaxReconnectionAttempts = 5","path":"server.go","position":7,"original_position":7,"commit_id":"9c1fe1dc05a68831c31e6f7bb967b0c35aa98caf","original_commit_id":"9c1fe1dc05a68831c31e6f7bb967b0c35aa98caf","user":{"login":"DanielKrawisz","id":4990891,"avatar_url":"https://avatars.githubusercontent.com/u/4990891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielKrawisz","html_url":"https://github.com/DanielKrawisz","followers_url":"https://api.github.com/users/DanielKrawisz/followers","following_url":"https://api.github.com/users/DanielKrawisz/following{/other_user}","gists_url":"https://api.github.com/users/DanielKrawisz/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielKrawisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielKrawisz/subscriptions","organizations_url":"https://api.github.com/users/DanielKrawisz/orgs","repos_url":"https://api.github.com/users/DanielKrawisz/repos","events_url":"https://api.github.com/users/DanielKrawisz/events{/privacy}","received_events_url":"https://api.github.com/users/DanielKrawisz/received_events","type":"User","site_admin":false},"body":"Yes, but it is only called repeatedly for persistent peers. Other kinds of peers are just forgotten if the connection fails. They may be connected randomly later if the address is pulled from the address manager, but then we don't keep track of reconnection attempts. ","created_at":"2015-07-29T03:01:18Z","updated_at":"2015-07-29T03:01:18Z","html_url":"https://github.com/monetas/bmd/pull/50#discussion_r35724327","pull_request_url":"https://api.github.com/repos/monetas/bmd/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/monetas/bmd/pulls/comments/35724327"},"html":{"href":"https://github.com/monetas/bmd/pull/50#discussion_r35724327"},"pull_request":{"href":"https://api.github.com/repos/monetas/bmd/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/monetas/bmd/pulls/50","id":41011410,"html_url":"https://github.com/monetas/bmd/pull/50","diff_url":"https://github.com/monetas/bmd/pull/50.diff","patch_url":"https://github.com/monetas/bmd/pull/50.patch","issue_url":"https://api.github.com/repos/monetas/bmd/issues/50","number":50,"state":"open","locked":false,"title":"Fix bug that caused server to run out of peers.","user":{"login":"DanielKrawisz","id":4990891,"avatar_url":"https://avatars.githubusercontent.com/u/4990891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielKrawisz","html_url":"https://github.com/DanielKrawisz","followers_url":"https://api.github.com/users/DanielKrawisz/followers","following_url":"https://api.github.com/users/DanielKrawisz/following{/other_user}","gists_url":"https://api.github.com/users/DanielKrawisz/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielKrawisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielKrawisz/subscriptions","organizations_url":"https://api.github.com/users/DanielKrawisz/orgs","repos_url":"https://api.github.com/users/DanielKrawisz/repos","events_url":"https://api.github.com/users/DanielKrawisz/events{/privacy}","received_events_url":"https://api.github.com/users/DanielKrawisz/received_events","type":"User","site_admin":false},"body":"The server kept entering a state in which none of its peers were doing anything but they were not getting removed from the PeerState. Basically, what happens is that the peer is sometimes added to the peer state before it has even connected. This is done to make it so that the peers are counted when the server detects whether it needs more peers to connect to. However, if the initial connection attempt failed, there was no guarantee that the peer would be removed from PeerState. I have rewritten some things so that the peer is guaranteed to be removed if the initial connection attempt fails.","created_at":"2015-07-28T13:32:26Z","updated_at":"2015-07-29T03:01:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"276d19fa8462372b43066990349774ef441ba9d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/monetas/bmd/pulls/50/commits","review_comments_url":"https://api.github.com/repos/monetas/bmd/pulls/50/comments","review_comment_url":"https://api.github.com/repos/monetas/bmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/monetas/bmd/issues/50/comments","statuses_url":"https://api.github.com/repos/monetas/bmd/statuses/9c1fe1dc05a68831c31e6f7bb967b0c35aa98caf","head":{"label":"DanielKrawisz:bug_fix","ref":"bug_fix","sha":"9c1fe1dc05a68831c31e6f7bb967b0c35aa98caf","user":{"login":"DanielKrawisz","id":4990891,"avatar_url":"https://avatars.githubusercontent.com/u/4990891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielKrawisz","html_url":"https://github.com/DanielKrawisz","followers_url":"https://api.github.com/users/DanielKrawisz/followers","following_url":"https://api.github.com/users/DanielKrawisz/following{/other_user}","gists_url":"https://api.github.com/users/DanielKrawisz/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielKrawisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielKrawisz/subscriptions","organizations_url":"https://api.github.com/users/DanielKrawisz/orgs","repos_url":"https://api.github.com/users/DanielKrawisz/repos","events_url":"https://api.github.com/users/DanielKrawisz/events{/privacy}","received_events_url":"https://api.github.com/users/DanielKrawisz/received_events","type":"User","site_admin":false},"repo":{"id":34642817,"name":"bmd","full_name":"DanielKrawisz/bmd","owner":{"login":"DanielKrawisz","id":4990891,"avatar_url":"https://avatars.githubusercontent.com/u/4990891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielKrawisz","html_url":"https://github.com/DanielKrawisz","followers_url":"https://api.github.com/users/DanielKrawisz/followers","following_url":"https://api.github.com/users/DanielKrawisz/following{/other_user}","gists_url":"https://api.github.com/users/DanielKrawisz/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielKrawisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielKrawisz/subscriptions","organizations_url":"https://api.github.com/users/DanielKrawisz/orgs","repos_url":"https://api.github.com/users/DanielKrawisz/repos","events_url":"https://api.github.com/users/DanielKrawisz/events{/privacy}","received_events_url":"https://api.github.com/users/DanielKrawisz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanielKrawisz/bmd","description":"","fork":true,"url":"https://api.github.com/repos/DanielKrawisz/bmd","forks_url":"https://api.github.com/repos/DanielKrawisz/bmd/forks","keys_url":"https://api.github.com/repos/DanielKrawisz/bmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanielKrawisz/bmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanielKrawisz/bmd/teams","hooks_url":"https://api.github.com/repos/DanielKrawisz/bmd/hooks","issue_events_url":"https://api.github.com/repos/DanielKrawisz/bmd/issues/events{/number}","events_url":"https://api.github.com/repos/DanielKrawisz/bmd/events","assignees_url":"https://api.github.com/repos/DanielKrawisz/bmd/assignees{/user}","branches_url":"https://api.github.com/repos/DanielKrawisz/bmd/branches{/branch}","tags_url":"https://api.github.com/repos/DanielKrawisz/bmd/tags","blobs_url":"https://api.github.com/repos/DanielKrawisz/bmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanielKrawisz/bmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanielKrawisz/bmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanielKrawisz/bmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanielKrawisz/bmd/statuses/{sha}","languages_url":"https://api.github.com/repos/DanielKrawisz/bmd/languages","stargazers_url":"https://api.github.com/repos/DanielKrawisz/bmd/stargazers","contributors_url":"https://api.github.com/repos/DanielKrawisz/bmd/contributors","subscribers_url":"https://api.github.com/repos/DanielKrawisz/bmd/subscribers","subscription_url":"https://api.github.com/repos/DanielKrawisz/bmd/subscription","commits_url":"https://api.github.com/repos/DanielKrawisz/bmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanielKrawisz/bmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanielKrawisz/bmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanielKrawisz/bmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanielKrawisz/bmd/contents/{+path}","compare_url":"https://api.github.com/repos/DanielKrawisz/bmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanielKrawisz/bmd/merges","archive_url":"https://api.github.com/repos/DanielKrawisz/bmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanielKrawisz/bmd/downloads","issues_url":"https://api.github.com/repos/DanielKrawisz/bmd/issues{/number}","pulls_url":"https://api.github.com/repos/DanielKrawisz/bmd/pulls{/number}","milestones_url":"https://api.github.com/repos/DanielKrawisz/bmd/milestones{/number}","notifications_url":"https://api.github.com/repos/DanielKrawisz/bmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanielKrawisz/bmd/labels{/name}","releases_url":"https://api.github.com/repos/DanielKrawisz/bmd/releases{/id}","created_at":"2015-04-27T02:56:09Z","updated_at":"2015-06-07T05:18:54Z","pushed_at":"2015-07-28T14:27:39Z","git_url":"git://github.com/DanielKrawisz/bmd.git","ssh_url":"git@github.com:DanielKrawisz/bmd.git","clone_url":"https://github.com/DanielKrawisz/bmd.git","svn_url":"https://github.com/DanielKrawisz/bmd","homepage":null,"size":1824,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"monetas:master","ref":"master","sha":"27c264e9b8292f1685b635ce3cacb87ed7689417","user":{"login":"monetas","id":4219418,"avatar_url":"https://avatars.githubusercontent.com/u/4219418?v=3","gravatar_id":"","url":"https://api.github.com/users/monetas","html_url":"https://github.com/monetas","followers_url":"https://api.github.com/users/monetas/followers","following_url":"https://api.github.com/users/monetas/following{/other_user}","gists_url":"https://api.github.com/users/monetas/gists{/gist_id}","starred_url":"https://api.github.com/users/monetas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monetas/subscriptions","organizations_url":"https://api.github.com/users/monetas/orgs","repos_url":"https://api.github.com/users/monetas/repos","events_url":"https://api.github.com/users/monetas/events{/privacy}","received_events_url":"https://api.github.com/users/monetas/received_events","type":"Organization","site_admin":false},"repo":{"id":32594697,"name":"bmd","full_name":"monetas/bmd","owner":{"login":"monetas","id":4219418,"avatar_url":"https://avatars.githubusercontent.com/u/4219418?v=3","gravatar_id":"","url":"https://api.github.com/users/monetas","html_url":"https://github.com/monetas","followers_url":"https://api.github.com/users/monetas/followers","following_url":"https://api.github.com/users/monetas/following{/other_user}","gists_url":"https://api.github.com/users/monetas/gists{/gist_id}","starred_url":"https://api.github.com/users/monetas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monetas/subscriptions","organizations_url":"https://api.github.com/users/monetas/orgs","repos_url":"https://api.github.com/users/monetas/repos","events_url":"https://api.github.com/users/monetas/events{/privacy}","received_events_url":"https://api.github.com/users/monetas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/monetas/bmd","description":"Implementation of Bitmessage protocol in Go -- Alpha/Experimental Code","fork":false,"url":"https://api.github.com/repos/monetas/bmd","forks_url":"https://api.github.com/repos/monetas/bmd/forks","keys_url":"https://api.github.com/repos/monetas/bmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monetas/bmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monetas/bmd/teams","hooks_url":"https://api.github.com/repos/monetas/bmd/hooks","issue_events_url":"https://api.github.com/repos/monetas/bmd/issues/events{/number}","events_url":"https://api.github.com/repos/monetas/bmd/events","assignees_url":"https://api.github.com/repos/monetas/bmd/assignees{/user}","branches_url":"https://api.github.com/repos/monetas/bmd/branches{/branch}","tags_url":"https://api.github.com/repos/monetas/bmd/tags","blobs_url":"https://api.github.com/repos/monetas/bmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monetas/bmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monetas/bmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/monetas/bmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monetas/bmd/statuses/{sha}","languages_url":"https://api.github.com/repos/monetas/bmd/languages","stargazers_url":"https://api.github.com/repos/monetas/bmd/stargazers","contributors_url":"https://api.github.com/repos/monetas/bmd/contributors","subscribers_url":"https://api.github.com/repos/monetas/bmd/subscribers","subscription_url":"https://api.github.com/repos/monetas/bmd/subscription","commits_url":"https://api.github.com/repos/monetas/bmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/monetas/bmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/monetas/bmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/monetas/bmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/monetas/bmd/contents/{+path}","compare_url":"https://api.github.com/repos/monetas/bmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monetas/bmd/merges","archive_url":"https://api.github.com/repos/monetas/bmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monetas/bmd/downloads","issues_url":"https://api.github.com/repos/monetas/bmd/issues{/number}","pulls_url":"https://api.github.com/repos/monetas/bmd/pulls{/number}","milestones_url":"https://api.github.com/repos/monetas/bmd/milestones{/number}","notifications_url":"https://api.github.com/repos/monetas/bmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monetas/bmd/labels{/name}","releases_url":"https://api.github.com/repos/monetas/bmd/releases{/id}","created_at":"2015-03-20T16:29:15Z","updated_at":"2015-07-12T03:00:48Z","pushed_at":"2015-07-28T14:27:39Z","git_url":"git://github.com/monetas/bmd.git","ssh_url":"git@github.com:monetas/bmd.git","clone_url":"https://github.com/monetas/bmd.git","svn_url":"https://github.com/monetas/bmd","homepage":"","size":2252,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/monetas/bmd/pulls/50"},"html":{"href":"https://github.com/monetas/bmd/pull/50"},"issue":{"href":"https://api.github.com/repos/monetas/bmd/issues/50"},"comments":{"href":"https://api.github.com/repos/monetas/bmd/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/monetas/bmd/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/monetas/bmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/monetas/bmd/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/monetas/bmd/statuses/9c1fe1dc05a68831c31e6f7bb967b0c35aa98caf"}}}}