You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
ISSUE-16527: Due to missing Python GIL management, Python clients constructed with a non-default Logger fail to clean up their threads and often segfault when Python garbage collects them
#4522
Describe the bug
If I build a Pulsar client object in Python and supply a logger= value that is not the default result of logging.getLogger(), e.g. logging.getLogger("foobar"), and if I interact with that Pulsar object from a thread in Python while another thread is running, two things happen:
When that Client object is GC'd by python, there is a chance of a segmentation fault occurring if one or more other Python interpreter threads are in the midst of some fairly common interpreter operations (also related to GC).
Symptoms: if you interact with pulsar Client objects in threads, disconnecting/reconnecting leaks threads and other resources, and can segfault Python.
To Reproduce
With an existing topic in TOPIC_NAME, run the below snippet:
Observe that the "final threadcount" value emitted by that code is >1.
On repeat runs (I did a while python repro.py; echo iterated; done), observe that the code eventually segfaults and crashes.
Expected behavior
After a thread running the Pulsar client is .joined, no side effects from its runtime should unexpectedly exist. The "final threadcount" value printed above should always be 1.
Segfaults should not occur while using Pulsar clients normally.
Desktop (please complete the following information):
OS: MacOS 12.4 x86 (also observed segfaults on Amazon Linux and Ubuntu-in-docker on MacOS).
Pulsar client: 2.10.1.
The text was updated successfully, but these errors were encountered:
Original Issue: apache#16527
Describe the bug
If I build a Pulsar client object in Python and supply a
logger=
value that is not the default result oflogging.getLogger()
, e.g.logging.getLogger("foobar")
, and if I interact with that Pulsar object from a thread in Python while another thread is running, two things happen:Symptoms: if you interact with pulsar Client objects in threads, disconnecting/reconnecting leaks threads and other resources, and can segfault Python.
To Reproduce
TOPIC_NAME
, run the below snippet:while python repro.py; echo iterated; done
), observe that the code eventually segfaults and crashes.Expected behavior
.join
ed, no side effects from its runtime should unexpectedly exist. The "final threadcount" value printed above should always be 1.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: