Skip to content

Conversation

@remimd
Copy link
Member

@remimd remimd commented Jan 1, 2026

No description provided.

Copy link

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 pull request fixes an async deadlock issue that occurs when there are circular dependencies during dependency injection. The fix introduces early detection of recursive instantiation calls and improves thread-safety configuration.

  • Adds circular dependency detection in CacheLogic by tracking instantiation state and raising RecursionError when recursion is detected
  • Improves environment variable parsing for thread-safety configuration to properly handle numeric values
  • Adds threadsafe parameter to injection provider methods for better control over locking behavior

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uv.lock Updates dependency versions: backports-zstd (1.2.0 → 1.3.0), pymdown-extensions (10.19.1 → 10.20), and uv (0.9.18 → 0.9.21)
injection/_core/scope.py Removes redundant ScopeKind conversion since the type annotation already enforces valid values through ScopeKind | ScopeKindStr
injection/_core/locator.py Adds threadsafe parameter to make_injected_function, passes threadsafe=False for recipe injection to prevent deadlocks, and renames value to injectable for clarity
injection/_core/injectables.py Implements circular dependency detection by tracking instantiation state with __is_instantiating flag and raising RecursionError when recursive calls are detected
injection/_core/common/threading.py Fixes environment variable parsing to properly handle PYTHON_INJECTION_THREADSAFE as an integer value, and improves variable naming from cond to threadsafe

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

@remimd remimd merged commit 132e5ef into dev Jan 1, 2026
6 checks passed
@remimd remimd deleted the fix branch January 1, 2026 13:37
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.

2 participants