Skip to content

Hard Timeout Triggers AttributeError on Windows #375

Closed

Description

@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.

Activity

  1. reggiepy commented on Apr 7, 2024

    @reggiepy

    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

  2. added a commit that references this issue on Oct 13, 2026
    531c3ae
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions