You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Hi,
I rewrote the Windows code handling overlapped operations to fix a crash when a
_WaitHandleFuture was cancelled, to log errors and more generally to cleanup
the code.
I tried to clear the reference the overlapped operation in _OverlappedFuture.
_OverlappedFuture.set_exception() now cancels the operation and then clears the
reference, it works. _OverlappedFuture.cancel() does the same and it works too.
But when I try to clear the reference to the overlapped operation in
_OverlappedFuture.set_result(), I get random errors. It looks the problem only
occurs in the fast-path of IocpProactor._register(), when the overlapped is not
added to _cache. It looks like clearing the reference in _poll(), when
GetQueuedCompletionStatus() got the status of the operation, it works.
I tried to add the overlapped into _cache but then the event loop hangs or
raises other errors.
I don't see how to fix the issue. There is a bug somewhere or I misunderstood
how overlapped operations works. Is it important that
GetQueuedCompletionStatus() reads the status of the operation? Or should we
*cancel* the operation after getting the result?
It's really strange because in _register(), the overlapped is not added to
_cache is the overlapped is not pending. But I get errors in the overlapped
destructor. According to the destructor code, I'm not supposed to get errors if
the overlapped already completed.
Maybe I looked at the wrong overlapped object. I don't know.
Original issue reported on code.google.com by victor.s...@gmail.com on 25 Jul 2014 at 11:16