Persistent connection extension not freeing connections until server is restarted

From: Date: Thu, 07 Aug 2003 01:57:10 +0000
Subject: Persistent connection extension not freeing connections until server is restarted
Groups: php.general 
Request: Send a blank email to php-general+get-158590@lists.php.net to get a copy of this message
Hi all, I have a fairly advanced question regarding writting modules that create persistent resources: I've written a module very similar to the 'de-facto standard' mysql implementation, however its developed a strange bug. Occasionally, after working with a persistent connection for a few page calls, php seems to 'forget' that its there, without calling the resources' cleanup handler. The eventual result, sence the resource opens a socket connection to another server (my module binds another API into php), the connections will pile up needlessly. I've done all the normal debugging, including adding E_NOTICE errors to find exactly the path through the code thats being taken. The same result every time, for the exact same 'hashed_identifier' the plink is found a few times, then mysteriously isnt, with no call to the resources' cleanup handler. Also, interestingly enough, explicit calls to zend_list_delete(Z_RESVAL_PP(link)); does not seem to call the cleanup handler either. When I restart apache and thus mod_php all the connections are promply and correctly closed using the cleanup handler. If anyone is interested in taking a look, http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/evopvr/evopvrd/src/evophp/php_evopvr.c?rev=1.8&content-type=text/vnd.viewcvs-markup is my module source in CVS. Appreciate any help or feedback, Thanks Matt Anderson

« previous php.general (#158590) next »