[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) asyncio: sync with Tulip

victor.stinner python-checkins at python.org
Fri Jul 25 22:40:28 CEST 2014


http://hg.python.org/cpython/rev/0f7b602d1b1f
changeset:   91872:0f7b602d1b1f
parent:      91870:42276ad3acef
parent:      91871:ed8672e19db3
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jul 25 22:40:12 2014 +0200
summary:
  (Merge 3.4) asyncio: sync with Tulip

* Tulip issue #196: IocpProactor._poll() clears the reference to the
  overlapped operation when the operation is done. It would be better to clear
  the reference in a new _OverlappedFuture.set_result() method, but it cannot
  be done yet because of a weird bug.
* BaseSelectorEventLoop._write_to_self() now logs errors in debug mode.

files:
  Lib/asyncio/selector_events.py |  5 ++++-
  Lib/asyncio/windows_events.py  |  5 +++++
  2 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -120,7 +120,10 @@
             try:
                 csock.send(b'\0')
             except OSError:
-                pass
+                if self._debug:
+                    logger.debug("Fail to write a null byte into the "
+                                 "self-pipe socket",
+                                 exc_info=True)
 
     def _start_serving(self, protocol_factory, sock,
                        sslcontext=None, server=None):
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -489,6 +489,11 @@
                 else:
                     f.set_result(value)
                     self._results.append(f)
+                    # FIXME, tulip issue #196: add _OverlappedFuture.set_result()
+                    # method to clear the refrence, don't do it here (f may
+                    # by a _WaitHandleFuture). Problem: clearing the reference
+                    # in _register() if ov.pedding is False leads to weird bugs.
+                    f._ov = None
             ms = 0
 
     def _stop_serving(self, obj):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list