My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 11: GIL problems
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  mkleehammer
Closed:  Dec 2008


 
Reported by kevin.ma...@gmail.com, Dec 4, 2008
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. 



Dec 4, 2008
Project Member #1 mkleehammer
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.

Status: Investigating
Owner: mkleehammer
Dec 4, 2008
#2 kevin.ma...@gmail.com
Cool--I'd like to be able to switch back to pyodbc at some point as the performance 
is a lot better than adodbapi. 
Dec 6, 2008
Project Member #3 mkleehammer
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?
Status: Fixed
Dec 6, 2008
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: Started
Dec 8, 2008
#5 kevin.ma...@gmail.com
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
Dec 9, 2008
#6 kevin.ma...@gmail.com
btw I would need binaries for python version 2.5
Cheers, Kevin


Dec 30, 2008
Project Member #7 mkleehammer
Fixed in 2.1.3

Let me know what you think.

Status: Fixed
Nov 21, 2010
Project Member #8 mkleehammer
(No comment was entered for this change.)
Status: Complete

Powered by Google Project Hosting