Skip to content

🪲 BUG-#128: Fix Background mode blocking by removing immediate thread.join() - #152

Merged
FernandoCelmer merged 4 commits into
developfrom
feature/128
Apr 7, 2026
Merged

🪲 BUG-#128: Fix Background mode blocking by removing immediate thread.join()#152
FernandoCelmer merged 4 commits into
developfrom
feature/128

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Apr 6, 2026

Copy link
Copy Markdown
Member

Description

  • dotflow/core/workflow.py (Background.run): Remove blocking thread.join(), use daemon thread, store thread reference as self.thread
  • dotflow/core/workflow.py (Background.get_tasks): Return original self.tasks instead of empty self.queue to avoid race condition
  • dotflow/core/workflow.py (Manager.init): Skip _callback_workflow for background mode since tasks have not completed yet
  • dotflow/core/workflow.py (Manager.background): Expose process.thread on Manager instance for optional explicit join

Motivation and Context

Background mode called thread.join() immediately after thread.start(), making it identical to sequential mode. Additionally, get_tasks() returned the empty queue (populated asynchronously by the thread), and _callback_workflow fired before any task had run. The fix ensures background mode is truly non-blocking while maintaining access to task objects and thread control.

Closes #128

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 bug Something isn't working critical Critical severity - must fix labels Apr 6, 2026
@FernandoCelmer FernandoCelmer self-assigned this Apr 6, 2026
@FernandoCelmer
FernandoCelmer deleted the feature/128 branch April 7, 2026 02:00
@FernandoCelmer
FernandoCelmer restored the feature/128 branch April 7, 2026 02:02
@FernandoCelmer FernandoCelmer reopened this Apr 7, 2026
@FernandoCelmer
FernandoCelmer merged commit 177369f into develop Apr 7, 2026
20 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/128 branch April 7, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working critical Critical severity - must fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant