Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-13 Thread Greg Ewing
Jesus Cea wrote: About controversial... keepalive are usually sent only when the connection is 100% idle for a while, when "while" can be >15 minutes, so the load should be "none" for regular connections. I guess the concern would be that the keepalive probe itself is subject to uncertain dela

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Guido van Rossum
On Mon, Apr 12, 2010 at 3:59 PM, Daniel Stutzbach wrote: > On Mon, Apr 12, 2010 at 5:34 PM, Jesus Cea wrote: >> >> The problem is: linux doesn't uses KEEPALIVE by default. > > If you believe the problem is with the Linux kernel, perhaps you should take > up your case on a more appropriate mailing

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:59 AM, Daniel Stutzbach wrote: > Most non-trivial applications use select() or poll() to avoid blocking > calls and do their own timeout-checking at the application layer, so > they don't need KEEPALIVE. I am thinking about python std

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Daniel Stutzbach
On Mon, Apr 12, 2010 at 5:34 PM, Jesus Cea wrote: > The problem is: linux doesn't uses KEEPALIVE by default. > If you believe the problem is with the Linux kernel, perhaps you should take up your case on a more appropriate mailing list? Python's socket module is a fairly low-level module, as it

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Antoine Pitrou
Jesus Cea jcea.es> writes: > > PS: "socket.setdefaulttimeout()" is not enough, because it could > shutdown a perfectly functional connection, just because it was idle for > too long. The socket timeout doesn't shutdown anything. It just puts a limit on how much time recv() and send() can block.

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:09 AM, Guido van Rossum wrote: > Also I recall reading that keepalives are a very > controversial concept (since they may actually break connections > unnecessarily if the internet merely has a hiccup). That is true, but parameters ar

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:09 AM, Guido van Rossum wrote: > Are you sure about this? ISTM that in most cases when a server goes > away unexpectedly the local host will discover this when it next tries > to use the socket. Also I recall reading that keepalives ar

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Guido van Rossum
Are you sure about this? ISTM that in most cases when a server goes away unexpectedly the local host will discover this when it next tries to use the socket. Also I recall reading that keepalives are a very controversial concept (since they may actually break connections unnecessarily if the intern

[Python-Dev] stdlib socket usage and "keepalive"

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Debugging a strange problem today, I got the following result: Sockets open by stdlib libraries are open without the "keepalive" option, so the system default is used. The system default under linux is "no keepalive". So, if you are using a URLlib co