Skip to content

🪲 BUG-#139: Add thread-safe lock to Background list append - #167

Merged
FernandoCelmer merged 1 commit into
developfrom
feature/139
Apr 7, 2026
Merged

🪲 BUG-#139: Add thread-safe lock to Background list append#167
FernandoCelmer merged 1 commit into
developfrom
feature/139

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Description

  • dotflow/core/workflow.py — Add threading.Lock to Background._flow_callback to protect list.append from race conditions

Motivation and Context

Background._flow_callback appends to a plain list from a background thread while get_tasks() reads from the main thread. While CPython's GIL makes list.append atomic, this is an implementation detail that may not hold in other Python implementations or future versions.

Closes #139

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 merged commit a1b3307 into develop Apr 7, 2026
10 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/139 branch April 7, 2026 03:25
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