Skip to content

set_wakeup_fd exception running in pywin32 service #378

@code-is-art

Description

@code-is-art

When running with async transport AIOHTTPTransport within a pywin32 Windows server 2019 service in python 3.10.9 I get a "set_wakeup_fd only works in main thread of the main interpreter" exception. I had to switch to a sync transport to get it to work. Currently using RequestsHTTPTransport with no problem. Here is the relevant part of the trace.

result = self.gql_client.execute(
  File "C:\Program Files\Python310\lib\site-packages\gql\client.py", line 378, in execute
    loop = asyncio.get_event_loop()
  File "C:\Program Files\Python310\lib\asyncio\events.py", line 668, in get_event_loop
    self.set_event_loop(self.new_event_loop())
  File "C:\Program Files\Python310\lib\asyncio\events.py", line 688, in new_event_loop
    return self._loop_factory()
  File "C:\Program Files\Python310\lib\asyncio\windows_events.py", line 315, in __init__
    super().__init__(proactor)
  File "C:\Program Files\Python310\lib\asyncio\proactor_events.py", line 639, in __init__
    signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread of the main interpreter

From my research it has to do with the way python handles asyncio after 3.7 and its preference for ProactorEventLoop. This would be on the gql 3.4.0 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs more informationWaiting on the issue author to add additional informationtype: bugAn issue or pull request relating to a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions