Azure / Azure/azure-sdk-for-python

Prevent circular dependencies with singleton classes and logs

Open
#44,671 0 comments 0 reactions 1 assignee Claimed by @rads-1996 View on GitHub
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

[Discussion](https://github.com/Azure/azure-sdk-for-python/pull/44661#discussion_r2692435577)
[Example issue](https://github.com/langchain-ai/langchain-azure/issues/234)

The core of this issue is that logs that are produced during setup hit the Breeze or Performance Counter log record processor that may still be in the process of starting up. This can cause circular dependencies and permanent Singleton locks. While this issue has been prevented by reordering setup, we should explore some more root-level solutions. For instance, I think we should change Singleton accessing to return None if the lock is stuck. This would prevent a crash at the cost of a single log being uncounted for the given processor. Alternatively, we could change the Live Metric and Performance Counter processors to not rely on the manager singletons directly, but rather use another module that the singleton relies on, too. This way, the processors can be fully independent of the managers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.