[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-06 Thread STINNER Victor
STINNER Victor added the comment: Thanks Martin for the long explanation. To simplify a lot, there is and was never any warranty that a successful sock.send() call delivered data to the peer. Each layer does its best, but the data can be lost at any layer, and the peer is free to close the connec

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread Martin Panter
Martin Panter added the comment: Thanks for handling this Victor. To answer some of your earlier questions, this is my understanding of the Free BSD behaviour (although I don't have Free BSD to experiment with): When writing to TCP sockets, I believe the data is buffered by the local OS (as w

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8207c17486baece8ed0ac42d9f8d69ecec4ba7e4 by Victor Stinner in branch 'master': Revert "bpo-30822: Fix testing of datetime module." (#2588) https://github.com/python/cpython/commit/8207c17486baece8ed0ac42d9f8d69ecec4ba7e4 --

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you Victor :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread STINNER Victor
STINNER Victor added the comment: Antoine: FYI I abandonned my idea of ignoring errors on socket.shutdown(), since I agree with your rationale. An application may rely on shutdown() exception to trigger some events, and a socket can still be used after a shutdown(). -- __

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: -alex ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: I don't see the link between this issue and bpo-30652 or bpo-30391, I removed these dependencies. I marked bpo-27784, bpo-30328, bpo-30543 and bpo-30315 as duplicates of this issue. bpo-30106 was already fixed, differently, but I mentioned this issue in it.

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: Ok. I modified socket.close() to ignore ECONNRESET in Python 3.6 and 3.7. I will leave the issue open a few days to see if it helps to reduce buildbot failure rate. -- ___ Python tracker

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: New changeset 580cd5cd3603317d294a881628880a92ea221334 by Victor Stinner in branch '3.6': bpo-30319: socket.close() now ignores ECONNRESET (#2565) (#2566) https://github.com/python/cpython/commit/580cd5cd3603317d294a881628880a92ea221334 -- __

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2635 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: New changeset 67e1478dba6efe60b8e1890192014b8b06dd6bd9 by Victor Stinner in branch 'master': bpo-30319: socket.close() now ignores ECONNRESET (#2565) https://github.com/python/cpython/commit/67e1478dba6efe60b8e1890192014b8b06dd6bd9 -- ___

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: I wrote https://github.com/python/cpython/pull/2565 because the ConnectionResetError error on socket.close() is more and more a cause of failures on FreeBSD buildbots. I mean that I fixed enough other bugs to start to only see one specific bug more often ;-) (

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: Ok, I rewrote my PR to only ignore ECONNRESET in socket.close(). -- ___ Python tracker ___ ___ Pytho

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 04/07/2017 à 14:00, STINNER Victor a écrit : > > Antoine Pitrou: "shutdown() is not the same thing as close()." > > I consider that the bug is similar to socket.close() error, > [...] First, let's not call it a bug when an error is reported to the user. A

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: I wrote https://github.com/python/cpython/pull/2565 * socket.close() now ignores ECONNRESET error * socket.shutdown() now ignores ENOTCONN and WSAEINVAL errors -- ___ Python tracker

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: Antoine Pitrou: "shutdown() is not the same thing as close()." I consider that the bug is similar to socket.close() error, since we also get an exception because the peer closed the connection. It's just the error code which is different. Antoine Pitrou: "If

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2632 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: shutdown() is not the same thing as close(). If you want to ignore errors on shutdown() you should open a separate issue (and argument for it, because "I saw the error on the buildbots" is not a sufficient reason IMHO). -- ___

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-04 Thread STINNER Victor
STINNER Victor added the comment: I propose to ignore ECONNRESET in socket.close() and ENOTCONN and WSAEINVAL on socket.shutdown(). If we see more failures later, we can extend these lists. asyncore also ignores ENOTCONN on socket.close(), but I don't trust this module at this point: it seems

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-03 Thread STINNER Victor
STINNER Victor added the comment: Another buildbot failure which may be related: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.6/builds/154/steps/test/logs/stdio test_write (test.test_socketserver.SocketWriterTest) ... Exception in thread serving: Traceback (most recent ca

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-03 Thread STINNER Victor
STINNER Victor added the comment: About versions, socket.close() was modified in Python 3.6 (bpo-26685) to raise an OSError on error. So only Python 3.6 and 3.7 are impacted here. -- title: ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6 ->