Skip to content

_IocpProactor implementation causes race condition (on Windows) #55

@peterazmanov

Description

@peterazmanov

Quamash uses separate thread for event polling. Polling in separate thread can cause race condition with 'event initiation' which is handled in MainThread. E.g. method recv of asyncio.windows_events.IocpProactor starts waiting to receive data from socket (via call to WSARecv) in MainThread. Before recv calls self._register(ov, conn, finish_recv) to register event in self._cache event is received in parallel poller thread (via call to GetQueuedCompletionStatus) and causes KeyError, in this case event is lost forever and app hangs on exit. I believe this bug is the reason for hangs in PR #44 (issue #38).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions