Hi, We are running cassandra using mock cassandra and interacting with python cassandra-driver. We are running python3.6 and we are using latest cassandra-driver i.e cassandra-driver 3.21.0. What we are seeing is when calling cluster.connect it is trying to acquire a tstate_lock from here *https://github.com/python/cpython/blob/3.6/Lib/threading.py#L1072* but we are running another process which has acquired this lock already, here *https://github.com/python/cpython/blob/3.6/Lib/threading.py#L899* but here the lock that is acquired is not getting released, it will be released after the process who has acquired the lock gets killed. So my program got stuck at cluster.connect call forever.
My question is why the lock which has been acquired here *https://github.com/python/cpython/blob/3.6/Lib/threading.py#L899* not getting released there itself. It will be released when process gets killed. Due to this my program is getting stuck forever.
Traceback (most recent call first): <built-in method acquire of _thread.lock object at remote 0x7f4c11dd4030> File "/usr/lib64/python3.6/threading.py", line 1072, in _wait_for_tstate_lock elif lock.acquire(block, timeout): File "/usr/lib64/python3.6/threading.py", line 1056, in join self._wait_for_tstate_lock() <cython_function_or_method at remote 0x7f4c180691b8> File "/root/mockcassandra.py", line 179, in verify_cassandra session = cluster.connect()
In the traceback, cluster.connect are trying to acquire the tstate_lock which is already acquired by another process and not releasing it until that process gets killed. In my case both process has to run in parallel. Can anyone suggest how can we proceed further?
On 2/4/2020 7:44 AM, pankajkumar--- via Python-Dev wrote:
We are running cassandra using mock cassandra and interacting with python cassandra-driver.
[We are having a problem with thread locks.]
Can anyone suggest how can we proceed further?
Python-dev is for development of future versions of Python and future CPython releases.
Questions about using current Python/CPython are usually better directed elsewhere, such as python-list.