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


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to