]> granicus.if.org Git - python/commitdiff
Backport of 83120 (#9032)
authorVictor Stinner <victor.stinner@haypocalc.com>
Sat, 24 Jul 2010 02:51:49 +0000 (02:51 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sat, 24 Jul 2010 02:51:49 +0000 (02:51 +0000)
XML-RPC client: Transport.request() retries on EPIPE error

The EPIPE error occurs when the server closes the socket and the client sends a
"big" XML-RPC request (I don't know exactly the size threshold).

request() just have to ignore the error because single_request() closes the
socket on error, and so the next call to single_request() will open a new
socket.

Remove also a comment in the HTTP client because it's now wrong: see r70643 and
issue #5542.

Lib/xmlrpclib.py
Misc/NEWS

index c7971cc4cfbda34633152b58d0590c069a4e015c..b6aed62e3b48667a52c1020a7c297e9132bfd96c 100644 (file)
@@ -1263,7 +1263,7 @@ class Transport:
             try:
                 return self.single_request(host, handler, request_body, verbose)
             except socket.error, e:
-                if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED):
+                if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED, errno.EPIPE):
                     raise
             except httplib.BadStatusLine: #close after we sent request
                 if i:
index 22aa5b88df2395e8ead263078566bf0cb3a309fd..915913743e4e800085df71fb47ccc8d063d94eae 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,10 @@ Core and Builtins
 Library
 -------
 
+- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
+  error occurs when the server closes the socket and the client sends a big
+  XML-RPC request.
+
 - Issue #5542: Remove special logic that closes HTTPConnection socket on EPIPE.
 
 - Issue #4629: getopt raises an error if an argument ends with = whereas getopt