Closed clueboy closed 11 years ago
From msabramo on August 10, 2013 13:58:10
Thanks for the bug report! I think that the patch in https://code.google.com/p/pymssql/issues/detail?id=107 will probably fix this. I don't know if I or Randy will get a chance to review it in the near future, but I want to. If you feel comfortable testing out the patch and reporting back if it fixes this issue, that will help move things forward a bit.
Status: Accepted
Labels: leak needstesting
From guillaume.pratte on August 11, 2013 07:47:31
The patch contained #107 is exactly to fix the issue you describe above. If you can test it that would be great!
From msabramo on August 13, 2013 21:05:13
The patch in #107 may or may not be needed.
From a quick experiment last night, it appears that this patch might not be needed after this commit: https://code.google.com/p/pymssql/source/detail?r=54554641cc7e487b9e8d5aa63b7085bc31a5f060 The above commit makes it so that connections actually get closed and removed from connection_object_list when they are out of scope.
Can you test it out?
Status: Fixed
From sokann on April 09, 2012 19:16:18
With the following script:
import pymssql
def get_connection(): return pymssql.connect( server='xxx', user='xxx', password='xxx', database='xxx', )
def run_dummy_query(): conn = get_connection() cur = conn.cursor() cur.execute('SELECT 1') row = cur.fetchone() print row
def main(): for i in range(10): run_dummy_query()
if name == 'main': main()
netstat shows 10 connections in ESTABLISHED instead of TIME_WAIT. Somehow the connections do not close themselves after going out of scope.
Tested with revision 005f1ac15065 .
Original issue: http://code.google.com/p/pymssql/issues/detail?id=88