Rev 6171: Got failures on Linux, even with adding 'fd' to the 'errors' on select. in http://bazaar.launchpad.net/~jameinel/bzr/drop-idle-connections-824797
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 16 13:37:45 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/drop-idle-connections-824797
------------------------------------------------------------
revno: 6171
revision-id: john at arbash-meinel.com-20110916133736-c6sd2jrqus2vbvp9
parent: john at arbash-meinel.com-20110916130440-pjfyoi0enlu8y6om
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: drop-idle-connections-824797
timestamp: Fri 2011-09-16 15:37:36 +0200
message:
Got failures on Linux, even with adding 'fd' to the 'errors' on select.
-------------- next part --------------
=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py 2011-09-16 13:04:40 +0000
+++ b/bzrlib/smart/medium.py 2011-09-16 13:37:36 +0000
@@ -294,13 +294,11 @@
# afterwards seems to raise EBADF.
# I think what happens is select.select is unable to see the
# status of a file that is closed after it starts 'sleeping'.
- # t_end = time.time() + timeout_seconds
- # poll_timeout = min(timeout_seconds, self._client_poll_timeout)
- # rs = []
- # while not rs and time.time() < t_end:
- # rs, _, _ = select.select([fd], [], [], poll_timeout)
+ t_end = time.time() + timeout_seconds
+ poll_timeout = min(timeout_seconds, self._client_poll_timeout)
rs = []
- rs, _, _ = select.select([fd], [], [], timeout_seconds)
+ while not rs and time.time() < t_end:
+ rs, _, _ = select.select([fd], [], [], poll_timeout)
except (select.error, socket.error) as e:
err = getattr(e, 'errno', None)
if err is None:
More information about the bazaar-commits
mailing list