open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.67k stars 571 forks source link

HTTP Worker Thread Blocked and Invalid Type Warning from Opentelemetry _logs #3858

Closed hyoinandout closed 1 month ago

hyoinandout commented 2 months ago

This issue might be related to the OpenTelemetry attributes and locks utilized by an application, resulting in one of deadlock symptoms.

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

Steps to reproduce Describe exactly how to reproduce the error. Include a code sample if applicable.

  1. Start the HTTP worker threads in the application.
  2. Send multiple REST API requests to a specific endpoint.
  3. Monitor the behavior of the HTTP worker threads or the log files for any warning messages.

What is the expected behavior? What did you expect to see?

What is the actual behavior? What did you see instead?

Additional context Add any other context about the problem here.

The blocked HTTP thread, along with the warning messages, are impacting the overall performance and behavior of the application. I wonder whether this deadlock symptom is a known issue.

hyoinandout commented 1 month ago

It turns out to be true; From image a thread holds a lock.

Then it reaches to the deadlock by trying to achieve the lock which the thread is already holding image