Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFError exception raised for unknown reason #189

Open
BabakAmini opened this issue Jan 5, 2024 · 0 comments
Open

EOFError exception raised for unknown reason #189

BabakAmini opened this issue Jan 5, 2024 · 0 comments

Comments

@BabakAmini
Copy link

BabakAmini commented Jan 5, 2024

Here is a simple code to test the apply() method, but it ended up with an EOFError exception:

import asyncio
from aiomultiprocess import Pool

async def worker():
    pass

async def main():
    async with Pool() as pool:
        tasks = [pool.apply(worker) for i in range(5)]
        await asyncio.gather(*tasks)

if __name__ == "__main__":
    asyncio.run(main())

Here is the output:

  File "/home/babak/web/test/TEST.py", line 14, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/babak/web/test/TEST.py", line 9, in main
    async with Pool() as pool:
               ^^^^^^
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/pool.py", line 186, in __init__
    self.init()
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/pool.py", line 214, in init
    self.processes[self.create_worker(qid)] = qid
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/pool.py", line 251, in create_worker
    process = PoolWorker(
              ^^^^^^^^^^^
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/pool.py", line 59, in __init__
    super().__init__(
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/core.py", line 109, in __init__
    namespace=get_manager().Namespace(),
              ^^^^^^^^^^^^^
  File "/home/babak/env_311/lib/python3.11/site-packages/aiomultiprocess/core.py", line 29, in get_manager
    _manager = context.Manager()
               ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/context.py", line 57, in Manager
    m.start()
  File "/usr/lib/python3.11/multiprocessing/managers.py", line 567, in start
    self._address = reader.recv()
                    ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
          ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 430, in _recv_bytes
    buf = self._recv(4)
          ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 399, in _recv
    raise EOFError

What am I doing wrong?

  • OS: Ubuntu 20.0.4 running on a cheap VPS with 1 core CPU and about 1.3 GB of free RAM
  • Python version: 3.12
  • aiomultiprocess version: 0.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant