{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/28874","labels_url":"https://api.github.com/repos/saltstack/salt/issues/28874/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/28874/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/28874/events","html_url":"https://github.com/saltstack/salt/pull/28874","id":116849448,"number":28874,"title":"Add keep-alive support to TCP transport","user":{"login":"skizunov","id":11562452,"avatar_url":"https://avatars.githubusercontent.com/u/11562452?v=3","gravatar_id":"","url":"https://api.github.com/users/skizunov","html_url":"https://github.com/skizunov","followers_url":"https://api.github.com/users/skizunov/followers","following_url":"https://api.github.com/users/skizunov/following{/other_user}","gists_url":"https://api.github.com/users/skizunov/gists{/gist_id}","starred_url":"https://api.github.com/users/skizunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skizunov/subscriptions","organizations_url":"https://api.github.com/users/skizunov/orgs","repos_url":"https://api.github.com/users/skizunov/repos","events_url":"https://api.github.com/users/skizunov/events{/privacy}","received_events_url":"https://api.github.com/users/skizunov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Core","name":"Core","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Expert%20Review%20Needed","name":"Expert Review Needed","color":"5319e7"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Transport","name":"Transport","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-13T20:50:47Z","updated_at":"2015-11-16T15:23:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/28874","html_url":"https://github.com/saltstack/salt/pull/28874","diff_url":"https://github.com/saltstack/salt/pull/28874.diff","patch_url":"https://github.com/saltstack/salt/pull/28874.patch"},"body":"salt/transport/tcp.py:\r\n- Added a utility function `_set_tcp_keepalive`. This function supports\r\nboth Windows `SIO_KEEPALIVE_VALS` and non Windows `TCP_KEEPIDLE`,\r\n`TCP_KEEPCNT`, `TCP_KEEPINTVL` variants of the tuning methods for\r\nkeep-alive.\r\n- Added keep-alive support for all incoming and outgoing non-IPC\r\nconnections: `TCPReqServerChannel`, `TCPPubServerChannel`,\r\n`AsyncTCPReqChannel` (via SaltMessageClient), `AsyncTCPPubChannel`\r\n(via SaltMessageClient)\r\n- To support SaltMessageClient, created a class `TCPClientKeepAlive`\r\nwhich wraps `tornado.tcpclient.TCPClient` and overrides `_create_stream`\r\nto be able to make the sockets keep-alive.\r\n\r\nsalt/config/__init__.py\r\n- For the master side, added default values for `tcp_keepalive` and\r\nfriends. Turned this on by default. These master-side versions aren't\r\n(currently) used in the zeromq transport, but are in the TCP transport.\r\nSome benefits to having master-side `tcp_keepalive`:\r\n  - The master will correctly detect the lack of presence of disconnected\r\n    minions (which were disconnectly via non-standard means such as\r\n    ethernet cable yank or cut power). eg, for events\r\n    `salt/presence/present` and `salt/presence/change`.\r\n  - Will clean up resources associated with no longer present minions.\r\n\r\nSigned-off-by: Sergey Kizunov <sergey.kizunov@ni.com>"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/157065798","html_url":"https://github.com/saltstack/salt/pull/28874#issuecomment-157065798","issue_url":"https://api.github.com/repos/saltstack/salt/issues/28874","id":157065798,"user":{"login":"cachedout","id":111616,"avatar_url":"https://avatars.githubusercontent.com/u/111616?v=3","gravatar_id":"","url":"https://api.github.com/users/cachedout","html_url":"https://github.com/cachedout","followers_url":"https://api.github.com/users/cachedout/followers","following_url":"https://api.github.com/users/cachedout/following{/other_user}","gists_url":"https://api.github.com/users/cachedout/gists{/gist_id}","starred_url":"https://api.github.com/users/cachedout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cachedout/subscriptions","organizations_url":"https://api.github.com/users/cachedout/orgs","repos_url":"https://api.github.com/users/cachedout/repos","events_url":"https://api.github.com/users/cachedout/events{/privacy}","received_events_url":"https://api.github.com/users/cachedout/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T15:23:58Z","updated_at":"2015-11-16T15:23:58Z","body":"@skizunov I took a look at it this morning and it looks great. I'm going to go ahead and merge this and we'll run the full test suite against it. Unfortunetely we don't have PR tests for the TCP transport yet. Thanks again for your very hard work here. This will be a good addition!"}}