celery / billiard

Multiprocessing Pool Extensions
Other
419 stars 252 forks source link

TypeError: argument must be an int, or have a fileno() method. #270

Closed paulocheque closed 1 year ago

paulocheque commented 5 years ago

billiard==3.5.0.5 OSX 10.14.2 Py 3.6

Hello, any ideas about this exception? Thanks in advance!

  File "/env/lib/python3.6/site-packages/billiard/managers.py", line 588, in __exit__
    self.shutdown()
  File "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/util.py", line 186, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/env/lib/python3.6/site-packages/billiard/managers.py", line 612, in _finalize_manager
    process.join(timeout=0.1)
  File "/env/lib/python3.6/site-packages/billiard/process.py", line 148, in join
    res = self._popen.wait(timeout)
  File "/env/lib/python3.6/site-packages/billiard/popen_fork.py", line 54, in wait
    if not wait([self.sentinel], timeout):
  File "/env/lib/python3.6/site-packages/billiard/connection.py", line 998, in wait
    return _poll(object_list, timeout)
  File "/env/lib/python3.6/site-packages/billiard/connection.py", line 970, in _poll
    pollster.register(fd, select.POLLIN)
TypeError: argument must be an int, or have a fileno() method.
auvipy commented 5 years ago

could you try new 3.6.0 release?

paulocheque commented 5 years ago

celery 4.2.1 has requirement billiard<3.6.0,>=3.5.0.2, but you'll have billiard 3.6.0.0 which is incompatible.

clokep commented 5 years ago

We're running celery 4.2.1 on billiard 3.6.0 and it works fine. 👍

clokep commented 5 years ago

@auvipy Not sure why you closed this, I was just responding to @paulocheque saying that you cannot use billiard 3.6.0 with celery 4.2.1. This seems like we should be updating the requirements in Celery though...

liuyoyi commented 5 years ago

@paulocheque Have you solved this problem?

paulocheque commented 5 years ago

I just forced to use the newest version of Celery and Billiard but I don't think the problem was completely solved.

Also, yes, they really need to release a new version to avoid this kind of lib dependency error.

KevinPoole commented 4 years ago

Hey all, anybody know what the latest is with this?

I am using:

billiard==3.6.3.0
celery==4.4.7

and getting this when I call proc.join(timeout=1)

Alphare commented 3 years ago

Simple reproduction using billiard==3.6.4.0:

from billiard import Queue, Process
import time

errors: Queue = Queue()
process = Process(target=lambda: time.sleep(5))
process.start()
process.join(1)
process.join(2)  # Fails here
benmosher commented 1 year ago

multiprocessing allows multiple joins, but this library calls close inside join here.

I think it should not, but this line of code is 8 years old! or maybe it should close inside the preceding if, so it only close-s if the process has completed?

Compare with the multiprocessing implementation of join here: https://github.com/python/cpython/blob/3.11/Lib/multiprocessing/process.py#L142