Skip to content

Make worker compatible with Windows#335

Merged
cunla merged 10 commits into
django-commons:masterfrom
gabriele-v:master
May 14, 2026
Merged

Make worker compatible with Windows#335
cunla merged 10 commits into
django-commons:masterfrom
gabriele-v:master

Conversation

@gabriele-v
Copy link
Copy Markdown
Contributor

Make worker compatible with Windows with three changes:

@DhavalGojiya DhavalGojiya requested a review from cunla April 20, 2026 11:17
Copilot AI review requested due to automatic review settings May 14, 2026 13:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make the scheduler worker behave correctly on Windows by avoiding Unix-only APIs and selecting an appropriate timeout (“death penalty”) implementation based on platform capabilities.

Changes:

  • Guard job forking so it’s only used when os.fork exists, otherwise run jobs in-process.
  • Replace os.uname()[1] with socket.gethostname() for cross-platform worker naming.
  • Select the default death-penalty implementation dynamically (SIGALRM-based vs timer-based).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scheduler/worker/worker.py Avoids Unix-only fork() usage when unavailable; uses socket.gethostname() for worker naming.
scheduler/types/settings_types.py Switches config default from a hard-coded Unix death penalty class to a platform-derived default.
scheduler/helpers/timeouts.py Introduces a helper to choose the default death penalty class based on SIGALRM availability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scheduler/worker/worker.py
Comment thread scheduler/worker/worker.py
@cunla cunla merged commit 10a9320 into django-commons:master May 14, 2026
7 of 28 checks passed
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

Successfully merging this pull request may close these issues.

3 participants