{"action":"created","comment":{"url":"https://api.github.com/repos/MariaDB/server/pulls/comments/120836693","pull_request_review_id":42832204,"id":120836693,"diff_hunk":"@@ -1000,6 +1000,28 @@ static int check_connection(THD *thd)\n     bzero((char*) &net->vio->remote, sizeof(net->vio->remote));\n   }\n   vio_keepalive(net->vio, TRUE);\n+\n+  if (global_system_variables.keepalive_probes != 9)","path":"sql/sql_connect.cc","position":null,"original_position":5,"commit_id":"24ff21ed5d1982fe07531be97eef8c0e7716ea01","original_commit_id":"29913413317f966c1de308991de71d271b1553c9","user":{"login":"vaintroub","id":1708204,"avatar_url":"https://avatars1.githubusercontent.com/u/1708204?v=3","gravatar_id":"","url":"https://api.github.com/users/vaintroub","html_url":"https://github.com/vaintroub","followers_url":"https://api.github.com/users/vaintroub/followers","following_url":"https://api.github.com/users/vaintroub/following{/other_user}","gists_url":"https://api.github.com/users/vaintroub/gists{/gist_id}","starred_url":"https://api.github.com/users/vaintroub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaintroub/subscriptions","organizations_url":"https://api.github.com/users/vaintroub/orgs","repos_url":"https://api.github.com/users/vaintroub/repos","events_url":"https://api.github.com/users/vaintroub/events{/privacy}","received_events_url":"https://api.github.com/users/vaintroub/received_events","type":"User","site_admin":false},"body":" a way to set keepalive interval and timeout on Windows, per socket , is here https://msdn.microsoft.com/en-us/library/windows/desktop/dd877220(v=vs.85).aspx . \r\nOn OSX, TCP_KEEPALIVE sets the interval https://stackoverflow.com/questions/15860127/how-to-configure-tcp-keepalive-under-mac-os-x . The probes are nowhere but on Linux, as I said","created_at":"2017-06-08T09:12:04Z","updated_at":"2017-06-08T09:12:04Z","html_url":"https://github.com/MariaDB/server/pull/400#discussion_r120836693","pull_request_url":"https://api.github.com/repos/MariaDB/server/pulls/400","_links":{"self":{"href":"https://api.github.com/repos/MariaDB/server/pulls/comments/120836693"},"html":{"href":"https://github.com/MariaDB/server/pull/400#discussion_r120836693"},"pull_request":{"href":"https://api.github.com/repos/MariaDB/server/pulls/400"}}},"pull_request":{"url":"https://api.github.com/repos/MariaDB/server/pulls/400","id":123088454,"html_url":"https://github.com/MariaDB/server/pull/400","diff_url":"https://github.com/MariaDB/server/pull/400.diff","patch_url":"https://github.com/MariaDB/server/pull/400.patch","issue_url":"https://api.github.com/repos/MariaDB/server/issues/400","number":400,"state":"open","locked":false,"title":"Add functionality to set keepalive tcp options","user":{"login":"leoleovich","id":4749052,"avatar_url":"https://avatars3.githubusercontent.com/u/4749052?v=3","gravatar_id":"","url":"https://api.github.com/users/leoleovich","html_url":"https://github.com/leoleovich","followers_url":"https://api.github.com/users/leoleovich/followers","following_url":"https://api.github.com/users/leoleovich/following{/other_user}","gists_url":"https://api.github.com/users/leoleovich/gists{/gist_id}","starred_url":"https://api.github.com/users/leoleovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoleovich/subscriptions","organizations_url":"https://api.github.com/users/leoleovich/orgs","repos_url":"https://api.github.com/users/leoleovich/repos","events_url":"https://api.github.com/users/leoleovich/events{/privacy}","received_events_url":"https://api.github.com/users/leoleovich/received_events","type":"User","site_admin":false},"body":"I tried to implement support of flexible configuration for `keepalive`.\r\nIf we take linux or macos, by default  values are too high and can not provide reliable work for production application (it is somewhere around 2,5 hours before keepalive actually starts working)\r\nBut lowering values for complete OS is not always an option, so it should be configurable on the application side. And in fact many applications can do it. For instance `postgres`. \r\nSo I suggest we add configuration variables:\r\n* `keepalive_time`\r\n* `keepalive_intvl`\r\n* `keepalive_probes`\r\nand use their values as socket options.\r\n\r\nFor meaning of params please check manual http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/","created_at":"2017-05-30T16:13:34Z","updated_at":"2017-06-08T09:12:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d015c4094e9d81166f52acd1fc87f6d1e255f4ba","assignee":{"login":"cvicentiu","id":2320573,"avatar_url":"https://avatars3.githubusercontent.com/u/2320573?v=3","gravatar_id":"","url":"https://api.github.com/users/cvicentiu","html_url":"https://github.com/cvicentiu","followers_url":"https://api.github.com/users/cvicentiu/followers","following_url":"https://api.github.com/users/cvicentiu/following{/other_user}","gists_url":"https://api.github.com/users/cvicentiu/gists{/gist_id}","starred_url":"https://api.github.com/users/cvicentiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvicentiu/subscriptions","organizations_url":"https://api.github.com/users/cvicentiu/orgs","repos_url":"https://api.github.com/users/cvicentiu/repos","events_url":"https://api.github.com/users/cvicentiu/events{/privacy}","received_events_url":"https://api.github.com/users/cvicentiu/received_events","type":"User","site_admin":false},"assignees":[{"login":"cvicentiu","id":2320573,"avatar_url":"https://avatars3.githubusercontent.com/u/2320573?v=3","gravatar_id":"","url":"https://api.github.com/users/cvicentiu","html_url":"https://github.com/cvicentiu","followers_url":"https://api.github.com/users/cvicentiu/followers","following_url":"https://api.github.com/users/cvicentiu/following{/other_user}","gists_url":"https://api.github.com/users/cvicentiu/gists{/gist_id}","starred_url":"https://api.github.com/users/cvicentiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvicentiu/subscriptions","organizations_url":"https://api.github.com/users/cvicentiu/orgs","repos_url":"https://api.github.com/users/cvicentiu/repos","events_url":"https://api.github.com/users/cvicentiu/events{/privacy}","received_events_url":"https://api.github.com/users/cvicentiu/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/MariaDB/server/milestones/2","html_url":"https://github.com/MariaDB/server/milestone/2","labels_url":"https://api.github.com/repos/MariaDB/server/milestones/2/labels","id":2355409,"number":2,"title":"10.2","description":null,"creator":{"login":"svoj","id":7700472,"avatar_url":"https://avatars1.githubusercontent.com/u/7700472?v=3","gravatar_id":"","url":"https://api.github.com/users/svoj","html_url":"https://github.com/svoj","followers_url":"https://api.github.com/users/svoj/followers","following_url":"https://api.github.com/users/svoj/following{/other_user}","gists_url":"https://api.github.com/users/svoj/gists{/gist_id}","starred_url":"https://api.github.com/users/svoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svoj/subscriptions","organizations_url":"https://api.github.com/users/svoj/orgs","repos_url":"https://api.github.com/users/svoj/repos","events_url":"https://api.github.com/users/svoj/events{/privacy}","received_events_url":"https://api.github.com/users/svoj/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":35,"state":"open","created_at":"2017-03-01T08:13:15Z","updated_at":"2017-06-08T06:53:13Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/MariaDB/server/pulls/400/commits","review_comments_url":"https://api.github.com/repos/MariaDB/server/pulls/400/comments","review_comment_url":"https://api.github.com/repos/MariaDB/server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MariaDB/server/issues/400/comments","statuses_url":"https://api.github.com/repos/MariaDB/server/statuses/24ff21ed5d1982fe07531be97eef8c0e7716ea01","head":{"label":"leoleovich:10.2","ref":"10.2","sha":"24ff21ed5d1982fe07531be97eef8c0e7716ea01","user":{"login":"leoleovich","id":4749052,"avatar_url":"https://avatars3.githubusercontent.com/u/4749052?v=3","gravatar_id":"","url":"https://api.github.com/users/leoleovich","html_url":"https://github.com/leoleovich","followers_url":"https://api.github.com/users/leoleovich/followers","following_url":"https://api.github.com/users/leoleovich/following{/other_user}","gists_url":"https://api.github.com/users/leoleovich/gists{/gist_id}","starred_url":"https://api.github.com/users/leoleovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoleovich/subscriptions","organizations_url":"https://api.github.com/users/leoleovich/orgs","repos_url":"https://api.github.com/users/leoleovich/repos","events_url":"https://api.github.com/users/leoleovich/events{/privacy}","received_events_url":"https://api.github.com/users/leoleovich/received_events","type":"User","site_admin":false},"repo":{"id":92755681,"name":"server","full_name":"leoleovich/server","owner":{"login":"leoleovich","id":4749052,"avatar_url":"https://avatars3.githubusercontent.com/u/4749052?v=3","gravatar_id":"","url":"https://api.github.com/users/leoleovich","html_url":"https://github.com/leoleovich","followers_url":"https://api.github.com/users/leoleovich/followers","following_url":"https://api.github.com/users/leoleovich/following{/other_user}","gists_url":"https://api.github.com/users/leoleovich/gists{/gist_id}","starred_url":"https://api.github.com/users/leoleovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoleovich/subscriptions","organizations_url":"https://api.github.com/users/leoleovich/orgs","repos_url":"https://api.github.com/users/leoleovich/repos","events_url":"https://api.github.com/users/leoleovich/events{/privacy}","received_events_url":"https://api.github.com/users/leoleovich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leoleovich/server","description":"MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.","fork":true,"url":"https://api.github.com/repos/leoleovich/server","forks_url":"https://api.github.com/repos/leoleovich/server/forks","keys_url":"https://api.github.com/repos/leoleovich/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leoleovich/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leoleovich/server/teams","hooks_url":"https://api.github.com/repos/leoleovich/server/hooks","issue_events_url":"https://api.github.com/repos/leoleovich/server/issues/events{/number}","events_url":"https://api.github.com/repos/leoleovich/server/events","assignees_url":"https://api.github.com/repos/leoleovich/server/assignees{/user}","branches_url":"https://api.github.com/repos/leoleovich/server/branches{/branch}","tags_url":"https://api.github.com/repos/leoleovich/server/tags","blobs_url":"https://api.github.com/repos/leoleovich/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leoleovich/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leoleovich/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/leoleovich/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leoleovich/server/statuses/{sha}","languages_url":"https://api.github.com/repos/leoleovich/server/languages","stargazers_url":"https://api.github.com/repos/leoleovich/server/stargazers","contributors_url":"https://api.github.com/repos/leoleovich/server/contributors","subscribers_url":"https://api.github.com/repos/leoleovich/server/subscribers","subscription_url":"https://api.github.com/repos/leoleovich/server/subscription","commits_url":"https://api.github.com/repos/leoleovich/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/leoleovich/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/leoleovich/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/leoleovich/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/leoleovich/server/contents/{+path}","compare_url":"https://api.github.com/repos/leoleovich/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leoleovich/server/merges","archive_url":"https://api.github.com/repos/leoleovich/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leoleovich/server/downloads","issues_url":"https://api.github.com/repos/leoleovich/server/issues{/number}","pulls_url":"https://api.github.com/repos/leoleovich/server/pulls{/number}","milestones_url":"https://api.github.com/repos/leoleovich/server/milestones{/number}","notifications_url":"https://api.github.com/repos/leoleovich/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leoleovich/server/labels{/name}","releases_url":"https://api.github.com/repos/leoleovich/server/releases{/id}","deployments_url":"https://api.github.com/repos/leoleovich/server/deployments","created_at":"2017-05-29T16:13:32Z","updated_at":"2017-05-29T16:14:41Z","pushed_at":"2017-06-08T08:49:08Z","git_url":"git://github.com/leoleovich/server.git","ssh_url":"git@github.com:leoleovich/server.git","clone_url":"https://github.com/leoleovich/server.git","svn_url":"https://github.com/leoleovich/server","homepage":"","size":524897,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"10.2"}},"base":{"label":"MariaDB:10.2","ref":"10.2","sha":"c4cbc7a8807250d2d5b5938b218fd9c423a0b30a","user":{"login":"MariaDB","id":4739304,"avatar_url":"https://avatars0.githubusercontent.com/u/4739304?v=3","gravatar_id":"","url":"https://api.github.com/users/MariaDB","html_url":"https://github.com/MariaDB","followers_url":"https://api.github.com/users/MariaDB/followers","following_url":"https://api.github.com/users/MariaDB/following{/other_user}","gists_url":"https://api.github.com/users/MariaDB/gists{/gist_id}","starred_url":"https://api.github.com/users/MariaDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariaDB/subscriptions","organizations_url":"https://api.github.com/users/MariaDB/orgs","repos_url":"https://api.github.com/users/MariaDB/repos","events_url":"https://api.github.com/users/MariaDB/events{/privacy}","received_events_url":"https://api.github.com/users/MariaDB/received_events","type":"Organization","site_admin":false},"repo":{"id":19816070,"name":"server","full_name":"MariaDB/server","owner":{"login":"MariaDB","id":4739304,"avatar_url":"https://avatars0.githubusercontent.com/u/4739304?v=3","gravatar_id":"","url":"https://api.github.com/users/MariaDB","html_url":"https://github.com/MariaDB","followers_url":"https://api.github.com/users/MariaDB/followers","following_url":"https://api.github.com/users/MariaDB/following{/other_user}","gists_url":"https://api.github.com/users/MariaDB/gists{/gist_id}","starred_url":"https://api.github.com/users/MariaDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariaDB/subscriptions","organizations_url":"https://api.github.com/users/MariaDB/orgs","repos_url":"https://api.github.com/users/MariaDB/repos","events_url":"https://api.github.com/users/MariaDB/events{/privacy}","received_events_url":"https://api.github.com/users/MariaDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MariaDB/server","description":"MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.","fork":false,"url":"https://api.github.com/repos/MariaDB/server","forks_url":"https://api.github.com/repos/MariaDB/server/forks","keys_url":"https://api.github.com/repos/MariaDB/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MariaDB/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MariaDB/server/teams","hooks_url":"https://api.github.com/repos/MariaDB/server/hooks","issue_events_url":"https://api.github.com/repos/MariaDB/server/issues/events{/number}","events_url":"https://api.github.com/repos/MariaDB/server/events","assignees_url":"https://api.github.com/repos/MariaDB/server/assignees{/user}","branches_url":"https://api.github.com/repos/MariaDB/server/branches{/branch}","tags_url":"https://api.github.com/repos/MariaDB/server/tags","blobs_url":"https://api.github.com/repos/MariaDB/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MariaDB/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MariaDB/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/MariaDB/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MariaDB/server/statuses/{sha}","languages_url":"https://api.github.com/repos/MariaDB/server/languages","stargazers_url":"https://api.github.com/repos/MariaDB/server/stargazers","contributors_url":"https://api.github.com/repos/MariaDB/server/contributors","subscribers_url":"https://api.github.com/repos/MariaDB/server/subscribers","subscription_url":"https://api.github.com/repos/MariaDB/server/subscription","commits_url":"https://api.github.com/repos/MariaDB/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/MariaDB/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/MariaDB/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/MariaDB/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/MariaDB/server/contents/{+path}","compare_url":"https://api.github.com/repos/MariaDB/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MariaDB/server/merges","archive_url":"https://api.github.com/repos/MariaDB/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MariaDB/server/downloads","issues_url":"https://api.github.com/repos/MariaDB/server/issues{/number}","pulls_url":"https://api.github.com/repos/MariaDB/server/pulls{/number}","milestones_url":"https://api.github.com/repos/MariaDB/server/milestones{/number}","notifications_url":"https://api.github.com/repos/MariaDB/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MariaDB/server/labels{/name}","releases_url":"https://api.github.com/repos/MariaDB/server/releases{/id}","deployments_url":"https://api.github.com/repos/MariaDB/server/deployments","created_at":"2014-05-15T10:58:50Z","updated_at":"2017-06-07T16:43:15Z","pushed_at":"2017-06-08T08:56:23Z","git_url":"git://github.com/MariaDB/server.git","ssh_url":"git@github.com:MariaDB/server.git","clone_url":"https://github.com/MariaDB/server.git","svn_url":"https://github.com/MariaDB/server","homepage":"","size":527077,"stargazers_count":1416,"watchers_count":1416,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":474,"mirror_url":null,"open_issues_count":50,"forks":474,"open_issues":50,"watchers":1416,"default_branch":"10.2"}},"_links":{"self":{"href":"https://api.github.com/repos/MariaDB/server/pulls/400"},"html":{"href":"https://github.com/MariaDB/server/pull/400"},"issue":{"href":"https://api.github.com/repos/MariaDB/server/issues/400"},"comments":{"href":"https://api.github.com/repos/MariaDB/server/issues/400/comments"},"review_comments":{"href":"https://api.github.com/repos/MariaDB/server/pulls/400/comments"},"review_comment":{"href":"https://api.github.com/repos/MariaDB/server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MariaDB/server/pulls/400/commits"},"statuses":{"href":"https://api.github.com/repos/MariaDB/server/statuses/24ff21ed5d1982fe07531be97eef8c0e7716ea01"}}}}
{"actor":{"display_login":"vaintroub"}}