Skip to content

🪲 BUG-#140: Fix race condition, thread tracking, and signal handler restoration in SchedulerCron - #168

Closed
FernandoCelmer wants to merge 3 commits into
developfrom
feature/140
Closed

🪲 BUG-#140: Fix race condition, thread tracking, and signal handler restoration in SchedulerCron#168
FernandoCelmer wants to merge 3 commits into
developfrom
feature/140

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Description

  • dotflow/providers/scheduler_cron.py — Three fixes for SchedulerCron

Fix 1 — Race condition in queue overlap (#140)

Move thread creation decision inside the lock in _execute_queued. The thread object is created under the lock and started after release, closing the window where _dispatch_queue could modify _queue_count.

Fix 2 — Daemon threads never joined (#142)

Track all spawned threads in _threads list. stop() now joins all in-flight threads with an optional timeout before returning.

Fix 3 — Signal handlers overwritten globally (#144)

Save previous SIGINT/SIGTERM handlers in _register_signals. Restore them in _restore_signals called from stop().

Closes #140
Closes #142
Closes #144

Types of changes

  • Bug fix (change that fixes an issue)
  • New feature (change which adds functionality)
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer added the bug Something isn't working label Apr 7, 2026
@FernandoCelmer
FernandoCelmer deleted the feature/140 branch April 7, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant