]> granicus.if.org Git - python/commitdiff
asyncio: sync with Tulip
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Jul 2014 20:36:05 +0000 (22:36 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Jul 2014 20:36:05 +0000 (22:36 +0200)
* 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.

Lib/asyncio/selector_events.py
Lib/asyncio/windows_events.py

index cd1a75aa78e265e8905035cf1d8ec85de3d5ab89..eca48b8e7c2bc587d1c40987a09899b85f8d2451 100644 (file)
@@ -120,7 +120,10 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
             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):
index 375003c4f1c25b90328aeb4ab36eb3994b4e9774..65ecf340316e25dfa9f4b25184a2d44e22cd9926 100644 (file)
@@ -489,6 +489,11 @@ class IocpProactor:
                 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):