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
I accidentally shared a connection object between threads in python3 ThreadPoolExecutor. I did not receive the error from my scripts because the execption is not caught by Python. It looks like something related to C. Sharing connection object works with psycopg2 or sqlite. This happens wity mysqlclient.
To Reproduce
Schema
Schema is generated by the script below. It is not very relevant.
mysqlclient allows sharing connection between threads.
You just don't allowed it used concurrently. In other words, you must use Lock to avoid using connection in same time from multiple threads.
This is not so different from sqlite3, although I don't know about pysocopg2.
On the other hand, I agree that raising Exception is better than abort in C.
I will consider what I can improve it.
Describe the bug
I accidentally shared a connection object between threads in python3 ThreadPoolExecutor. I did not receive the error from my scripts because the execption is not caught by Python. It looks like something related to C. Sharing connection object works with psycopg2 or sqlite. This happens wity mysqlclient.
To Reproduce
Schema
Schema is generated by the script below. It is not very relevant.
Code
docker-compose -f docker-compose.yaml up --build
docker-compose.yaml
python3 execute.py --share=1
execute.py
requirements.txt
To Reproduce
bash
Output
Also sometimes:
Environment
Additional context
This uncaught error kills jupyter notebook also without any tracebacks. That is how I discovered it.
The text was updated successfully, but these errors were encountered: