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

Hard Timeout Triggers AttributeError on Windows #375

Open
fedeesku opened this issue Sep 1, 2022 · 1 comment
Open

Hard Timeout Triggers AttributeError on Windows #375

fedeesku opened this issue Sep 1, 2022 · 1 comment

Comments

@fedeesku
Copy link

fedeesku commented Sep 1, 2022

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.

@reggiepy
Copy link

reggiepy commented Apr 7, 2024

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

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

2 participants