[Python-Dev] Minor socket timeout quibble - timeout raises socket.error

Bernard Yue bernie@3captus.com
Fri, 12 Jul 2002 13:29:17 -0600


This is a multi-part message in MIME format.
--------------67BDF2B7F2453AAB6129FCFC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Guido van Rossum wrote:
> 
> [Skip Montanaro]
> > > I just noticed in the development docs that when a timeout on a socket
> > > occurs, socket.error is raised.  I rather liked the idea that a different
> > > exception was raised for timeouts (I used Tim O'Malley's timeout_socket
> > > module).  Making a TimeoutError exception a subclass of socket.error would
> > > be fine so you can catch it with existing code, but I could see recovering
> > > differently for a timeout as opposed to other possible errors:
> > >
> > >     sock.settimeout(5.0)
> > >     try:
> > >         data = sock.recv(8192)
> > >     except socket.TimeoutError:
> > >         # maybe requeue the request
> > >         ...
> > >     except socket.error, codes:
> > >         # some more drastic solution is needed
> > >         ...
> > >
> 
> [Bernard Yue]
> > +1 on your suggestion.  Anyway, under windows, the current
> > implementation returns incorrect socket.error code for timeout.  I am
> > working on the test suite as well as a fix for problem found.  Once the
> > code is bug free maybe we can put the TimeoutError in.
> >
> > I will leave it to Guido for the approval of the change.  When he comes
> > back from his holiday.
> 
> The way I restructured the code it is impossible to distinguish a
> timeout error from other errors; you simply get the "no data
> available" error from the socket operation.  This is the same error
> you'd get in non-blocking mode.
> 

To distinguish a timeout error, the caller can check s->sock_timeout
when a non-blocking mode error occured, or just return an error code
from internal_select() (I guess you must have your reason to taken it
out in the first place)

> Before I recomplicate the code so that it can raise a separate error
> when the select fails, I'd like to understand the use case better.
> Why would you want to make this distinction?  Requeueing the request
> (as in Skip's example) doesn't make sense IMO: you set the timeout for
> a reason, and that reason is that you want to give up if it takes too
> long.  If you really intend to retry you're better of disabling the
> timeout!
>

How about the following (assume we have socket.setDefaultTimeout()):

    import socket
    import urllib

    socket.setDefaultTimeout(5.0)
    retry = 0
    url = 'some url'

    while retry < 3:
        try:
            file = urllib.urlretrieve(url)
        except socket.TimeoutError:
            if retry == 2:
                print "Server too busy, given up!"
                raise
            else:
                print "Server busy, retry!"
                retry += 1
        else:
            break

MS IIS behave strangely to http request.  When the server is very busy,
it will randomly drop some requests without disconnecting the client. 
So the best approach for the client is to timeout and retry.  I guess
that might be the reason why people needed timeoutsocket in the first
place.

> If you really want to, you can already distinguish the timeout case,
> because you get an EAGAIN error then (maybe something else on Windows
> -- Bernard, if you have a fix for that, please send it to me).
>

I am struggling with the test case for the new socket code.  The timeout
test case I've send you works with the old socketmodule.c (attached),
but not with the lastest version (on linux or windows).  It's strange,
your new implementation looks much cleaner.

Please bear with me a bit longer for a patch  :.(

> So a -0 unless more evidence is brought forward.
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)


Bernie
--------------67BDF2B7F2453AAB6129FCFC
Content-Type: application/vnd.lotus-organizer;
 name="socketmodule.c.org"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="socketmodule.c.org"

LyogU29ja2V0IG1vZHVsZSAqLwoKLyoKClRoaXMgbW9kdWxlIHByb3ZpZGVzIGFuIGludGVy
ZmFjZSB0byBCZXJrZWxleSBzb2NrZXQgSVBDLgoKTGltaXRhdGlvbnM6CgotIE9ubHkgQUZf
SU5FVCwgQUZfSU5FVDYgYW5kIEFGX1VOSVggYWRkcmVzcyBmYW1pbGllcyBhcmUgc3VwcG9y
dGVkIGluIGEKICBwb3J0YWJsZSBtYW5uZXIsIHRob3VnaCBBRl9QQUNLRVQgaXMgc3VwcG9y
dGVkIHVuZGVyIExpbnV4LgotIE5vIHJlYWQvd3JpdGUgb3BlcmF0aW9ucyAodXNlIHNlbmRh
bGwvcmVjdiBvciBtYWtlZmlsZSBpbnN0ZWFkKS4KLSBBZGRpdGlvbmFsIHJlc3RyaWN0aW9u
cyBhcHBseSBvbiBzb21lIG5vbi1Vbml4IHBsYXRmb3JtcyAoY29tcGVuc2F0ZWQKICBmb3Ig
Ynkgc29ja2V0LnB5KS4KCk1vZHVsZSBpbnRlcmZhY2U6CgotIHNvY2tldC5lcnJvcj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