Bobspadger / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

GIL problems #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've noticed in my multithreaded app using pyodbc with MS SQL Server 
occasional application freezes typical of the GIL not being released. It 
always seemed to happen when two threads were both calling stored 
procedures. In every case I noticed that there was a blocking SQL Server 
process with last command "exec sp_sproc_columns", I assume this is called 
by the driver when you are trying to build up the cursor.description. The 
fact that all my app threads freeze means the GIL is not released. As 
pyodbc is the only C python extension in use, it must be the one not 
releasing the GIL. 

Changing my app to use adodbapi fixed the problem 

Sorry I can't provide a test case that duplicates this problem. My app is 
huge and it would be a lot of work for me to whittle it down to a simple 
test case. If you make any changes that you think might fix this problem 
let me know and I'll rerun my app using pyodbc to see if the problem goes 
away. 

Original issue reported on code.google.com by kevin.ma...@gmail.com on 4 Dec 2008 at 3:08

GoogleCodeExporter commented 9 years ago
The lock is released around the "big" calls (queries, etc.), but I would not be
surprised if I missed some.  I will scour the code and add the calls.

Original comment by mkleehammer on 4 Dec 2008 at 3:15

GoogleCodeExporter commented 9 years ago
Cool--I'd like to be able to switch back to pyodbc at some point as the 
performance 
is a lot better than adodbapi. 

Original comment by kevin.ma...@gmail.com on 4 Dec 2008 at 3:30

GoogleCodeExporter commented 9 years ago
Kevin,

There were a lot more missing releases than I thought.  I've added the releases
around every ODBC call and pushed the commit to github.

I haven't tagged this as a new release and created an installer.  Can you build 
from
github and test?

Original comment by mkleehammer on 6 Dec 2008 at 5:14

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 6 Dec 2008 at 5:14

GoogleCodeExporter commented 9 years ago
hi--it's not easy for me to built from github. If you can provide an installer 
I'll 
test your changes though. Thanks, Kevin

Original comment by kevin.ma...@gmail.com on 8 Dec 2008 at 1:42

GoogleCodeExporter commented 9 years ago
btw I would need binaries for python version 2.5
Cheers, Kevin

Original comment by kevin.ma...@gmail.com on 9 Dec 2008 at 2:07

GoogleCodeExporter commented 9 years ago
Fixed in 2.1.3

Let me know what you think.

Original comment by mkleehammer on 31 Dec 2008 at 3:22

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 21 Nov 2010 at 4:44