michiya / django-pyodbc-azure

Django backend for Microsoft SQL Server and Azure SQL Database using pyodbc
https://pypi.python.org/pypi/django-pyodbc-azure
BSD 3-Clause "New" or "Revised" License
321 stars 140 forks source link

Server freeze when send multi-thread requests or send many times requests #162

Open S-Ladawisalsup opened 6 years ago

S-Ladawisalsup commented 6 years ago

I'm using python 3.4.3, django 2.0.4 for the web and using django-pyodcb-azure, pyodbc 4.0.23, unixodbc 2.2.14p2-5ubuntu5 and FreeTDS (TDS_Version=7.4) for connect to my database, MSSQL 2017, on Ubuntu 14.04.

My problem found is when my client-side send many requests at the same time through APIs that get data from database to response back. After requests are sent, server-side are freeze or no responding and can't do anythings without restart web server. I'm tried to testing server print state check for every process and the server will have no response on the process as I previously mentioned. That sometimes server is freeze and have no response and sometimes will find the error message

python: ../nptl/pthread_mutex_lock.c:80: pthread_mutex_lock: Assertion `mutex->data.__owner == 0' failed. Aborted (core dumped)

and web server automatically shutdown.

But I used to test by send a few requests that web program works correctly and server never freeze. That I suppose this problem cause from sending multi-thread requests or many times requests (but it's just my guess) or this problem cause from thread-safety or the database is locked by some processes and can I fixed it from your adapter's config? or this problem wasn't form these or I missed somethings?

Could someone give me a suggest to fixed my problem? Thanks