billiard icon indicating copy to clipboard operation
billiard copied to clipboard

Hard Timeout Triggers AttributeError on Windows

Open fedeesku opened this issue 3 years ago • 1 comments

Hi Team,

Running Billiards 4.0.2 on Windows 10.

A hard timeout threshold triggers the following error:

Thread 'TimeoutHandler' crashed: AttributeError("module 'os' has no attribute 'getpgid'") Traceback (most recent call last): File "xxx\lib\site-packages\billiard\pool.py", line 504, in run return self.body() File "xxx\lib\site-packages\billiard\pool.py", line 763, in body for _ in self.handle_timeouts(): File "xxx\lib\site-packages\billiard\pool.py", line 754, in handle_timeouts on_hard_timeout(job) File "xxx\lib\site-packages\billiard\pool.py", line 697, in on_hard_timeout self._trywaitkill(process) File "xxx\lib\site-packages\billiard\pool.py", line 702, in _trywaitkill if os.getpgid(worker.pid) == worker.pid: AttributeError: module 'os' has no attribute 'getpgid'

I believe if the OS is Windows then you should skip the first if statement and go directly to the else. Windows does not support getpgid.

Adding a sys.platform != "win32" as the first check in line 702 and 713 seems to fix the issue.

fedeesku avatar Sep 01 '22 15:09 fedeesku

Hi Team,

Running Billiards 4.0.2 on Windows 10.

A hard timeout threshold triggers the following error:

Thread 'TimeoutHandler' crashed: AttributeError("module 'os' has no attribute 'getpgid'") Traceback (most recent call last): File "xxx\lib\site-packages\billiard\pool.py", line 504, in run return self.body() File "xxx\lib\site-packages\billiard\pool.py", line 763, in body for _ in self.handle_timeouts(): File "xxx\lib\site-packages\billiard\pool.py", line 754, in handle_timeouts on_hard_timeout(job) File "xxx\lib\site-packages\billiard\pool.py", line 697, in on_hard_timeout self._trywaitkill(process) File "xxx\lib\site-packages\billiard\pool.py", line 702, in _trywaitkill if os.getpgid(worker.pid) == worker.pid: AttributeError: module 'os' has no attribute 'getpgid'

I believe if the OS is Windows then you should skip the first if statement and go directly to the else. Windows does not support getpgid.

Adding a sys.platform != "win32" as the first check in line 702 and 713 seems to fix the issue.

Thank you, I happen to have the same problem

reggiepy avatar Apr 07 '24 06:04 reggiepy