{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5655","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5655/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5655/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5655/events","html_url":"https://github.com/bitcoin/bitcoin/pull/5655","id":54274693,"number":5655,"title":"Add a -rpckeepalive and disable RPC use of HTTP persistent connections.","user":{"login":"gmaxwell","id":858454,"avatar_url":"https://avatars.githubusercontent.com/u/858454?v=3","gravatar_id":"","url":"https://api.github.com/users/gmaxwell","html_url":"https://github.com/gmaxwell","followers_url":"https://api.github.com/users/gmaxwell/followers","following_url":"https://api.github.com/users/gmaxwell/following{/other_user}","gists_url":"https://api.github.com/users/gmaxwell/gists{/gist_id}","starred_url":"https://api.github.com/users/gmaxwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmaxwell/subscriptions","organizations_url":"https://api.github.com/users/gmaxwell/orgs","repos_url":"https://api.github.com/users/gmaxwell/repos","events_url":"https://api.github.com/users/gmaxwell/events{/privacy}","received_events_url":"https://api.github.com/users/gmaxwell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/14","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/14/labels","id":505738,"number":14,"title":"0.10.0","description":"","creator":{"login":"laanwj","id":126646,"avatar_url":"https://avatars.githubusercontent.com/u/126646?v=3","gravatar_id":"","url":"https://api.github.com/users/laanwj","html_url":"https://github.com/laanwj","followers_url":"https://api.github.com/users/laanwj/followers","following_url":"https://api.github.com/users/laanwj/following{/other_user}","gists_url":"https://api.github.com/users/laanwj/gists{/gist_id}","starred_url":"https://api.github.com/users/laanwj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laanwj/subscriptions","organizations_url":"https://api.github.com/users/laanwj/orgs","repos_url":"https://api.github.com/users/laanwj/repos","events_url":"https://api.github.com/users/laanwj/events{/privacy}","received_events_url":"https://api.github.com/users/laanwj/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":109,"state":"open","created_at":"2013-12-05T10:34:42Z","updated_at":"2015-01-15T08:27:38Z","due_on":null,"closed_at":null},"comments":21,"created_at":"2015-01-14T01:54:15Z","updated_at":"2015-01-15T21:14:48Z","closed_at":"2015-01-15T08:27:38Z","pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5655","html_url":"https://github.com/bitcoin/bitcoin/pull/5655","diff_url":"https://github.com/bitcoin/bitcoin/pull/5655.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/5655.patch"},"body":"It turns out that some miners have been staying with old versions of\r\n Bitcoin Core because their software  behaves poorly with persistent\r\n connections and the Bitcoin Core thread and connection limits.\r\n\r\nWhat happens is that underlying  HTTP libraries leave connections open\r\n invisibly to their users and then the user runs into the default four\r\n thread limit.  This looks like Bitcoin Core is unresponsive to RPC.\r\n\r\nThere are many things that should be improved in Bitcoin Core's behavior\r\n here, e.g. supporting more concurrent connections, not tying up threads\r\n for idle connections, disconnecting kept-alive  connections when limits\r\n are reached, etc. All are fairly big, risky changes.\r\n\r\nDisabling keep-alive is a simple workaround. It's often not easy to turn\r\n off the keep-alive support in the client where it may be buried in some\r\n platform library.\r\n\r\nIf you are one of the few who really needs persistent connections you\r\n probably know that you want them and can find a switch; while if you\r\n don't and the misbehavior is hitting you it is hard to discover the\r\n source of your problems is keepalive related.  Given that it is best\r\n to default to off until they're handled better."},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/70162936","html_url":"https://github.com/bitcoin/bitcoin/pull/5655#issuecomment-70162936","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5655","id":70162936,"user":{"login":"gmaxwell","id":858454,"avatar_url":"https://avatars.githubusercontent.com/u/858454?v=3","gravatar_id":"","url":"https://api.github.com/users/gmaxwell","html_url":"https://github.com/gmaxwell","followers_url":"https://api.github.com/users/gmaxwell/followers","following_url":"https://api.github.com/users/gmaxwell/following{/other_user}","gists_url":"https://api.github.com/users/gmaxwell/gists{/gist_id}","starred_url":"https://api.github.com/users/gmaxwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmaxwell/subscriptions","organizations_url":"https://api.github.com/users/gmaxwell/orgs","repos_url":"https://api.github.com/users/gmaxwell/repos","events_url":"https://api.github.com/users/gmaxwell/events{/privacy}","received_events_url":"https://api.github.com/users/gmaxwell/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T21:14:48Z","updated_at":"2015-01-15T21:14:48Z","body":"Jeff, I read _every_ commit and PR related to the introduction of persistent connections. Not a single one of them mentioned this. I also initially created this a a default no change in behavior in the interest of being conservative, but unfortunately; you can't tell if it's the broken persistent connection support thats breaking you: it just looks like Bitcoin core is unresponsive. \r\n\r\nThe last round of changes that impacted our persistent connections was a massive regression which caused complaints from many users-- many more than the time_wait complaint. Apparently after our failure to do anything about it many people just stuck on 0.8.1. This is particularly problematic because some of the most frequently impacted parties were miners. I've also been told at conferences by various service providers that they'd switched to using hosted APIs due to Bitcoin core being unresponsive, which made no sense to me at the time. In the new light of being reminded why miners were staying stuck on 0.8.1, it finally does make sense.\r\n\r\nI'm open to having persist default to on (after all, that was my original PR),  but I think that doing so may be a mistake unless we really have reason to believe the timewait problems are more frequent than the others. I also think persistent connections are not the right solution for timewait in any case: isn't the correct solution SO_REUSEADDR.\r\n\r\n(I'm travelling today and won't be submitting any commits, so don't feel like waiting for me is required)"}}