Skip to content

Worker with ZeroMQ does not work on Windows with default configuration #524

Open

Description

@raidzin

Asynchronous ZeroMQ does not work on Windows with default asyncio.WindowsProactorEventLoopPolicy.

It raises:

RuntimeError: Proactor event loop does not implement add_reader family of methods required for zmq. zmq will work with proactor if tornado >= 6.1 can be found.
Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` or install 'tornado>=6.1' to avoid this error.

If I install tornado as required by the exception, then the worker starts, but there is a warning that I need to configure the eventloop.

RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.        
  self._get_loop()

Adding asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy()) to the application code has no effect for worker

Activity

  1. raidzin commented on Oct 24, 2025

    @raidzin
    ContributorAuthor

    @s3rius, I see two ways to solve this problem:

    1. We can add tornado as a platform-specific dependency when we use the optional zmq dependency. With this, the worker will start, but the warning will remain
    2. We can add a check that pyzmq is installed and os.name == 'nt' and then change the default EventLoopPolicy to WindowsSelectorEventLoopPolicy when worker starts

    To be honest, I can't say exactly what side effects the second option might have, but I tested on pure pyzmq and it worked without a tornado

  2. changed the title [-]Bug: Worker with ZeroMQ does not work on Windows with default configuration[/-] [+]Worker with ZeroMQ does not work on Windows with default configuration[/+] on Sep 17, 2026
  3. danfimov commented on Sep 17, 2026

    @danfimov
    Member

    The second option seems more optimal to me. I don't have Windows handy to test it myself, so if you try it out and come up with a fix, I'd be happy to review it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions