Enable TCP keep-alives in the twisted rpc client
authorIustin Pop <iustin@google.com>
Tue, 24 Jun 2008 10:44:44 +0000 (10:44 +0000)
committerIustin Pop <iustin@google.com>
Tue, 24 Jun 2008 10:44:44 +0000 (10:44 +0000)
commit9a40794e9ef19b37b3ec9c637a25a422b5dfa38e
tree11fa2eb0f619ec1c50d06b94cf2a5cda6b1e3232
parent9fd12df2d8e78f47b4602b142a061ac187aa5198
Enable TCP keep-alives in the twisted rpc client

Since a dead node will not be detected (in our current implementation)
by the twisted rpc layer, we should enable TCP-level keepalives in order
to at least detect TCP-level problems.

This patch changes the rpc.NodeController class to enable TCP-keepalives
before doing the remote call (so a failure in the connect/login sequence
will not be protected by this, but there twisted - if I understood
correctly - has its own timeouts).

We should always have a TCP-based transport under our object broker, but
I think it's better to check first for support of the setTcpKeepAlive
function and only if it's available call it.

Note that the interval and keepalive behaviour must be tuned at kernel
level (sysctls net.ipv4.tcp_keepalive_* in Linux) and cannot be tuned
from within our code.

Reviewed-by: imsnah
lib/rpc.py