php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5474 persistent connections not closed on Apache child exit
Submitted: 2000-07-09 00:24 UTC Modified: 2000-12-19 21:28 UTC
From: sasha at mysql dot com Assigned: zeev (profile)
Status: Closed Package: MySQL related
PHP Version: 4.0.1pl2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 45 = ?
Subscribe to this entry?

 
 [2000-07-09 00:24 UTC] sasha at mysql dot com
Set MaxRequestPerChild to 1, set MaxClients to 1,

mysql_pconnect();

hit the script a few times,

MySQL will see a lot of Aborted_clients ( show status to see it)

the reason is that persistent connections are not closed with mysql_close() on Apache child exit - the fix would be to take care of that in the child exit hanlder.

a call to mysql_close() is  part of the protocol, and it is an error to skip it.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-10 21:50 UTC] bmcadams@php.net
I can duplicate this problem internally on my production servers, so it is definitely a valid issue.
 [2000-08-12 04:12 UTC] bmcadams@php.net
Appears to be a valid issue.
Assigned to mysql extension author for review.
 [2000-12-19 21:28 UTC] sniper@php.net
Feedback by Steven Roussey <sroussey@network54.com>
--------------------------------------------

Seems like someone changed the mysql module in PHP 4.0.4RC3 with my
suggestions for #1. Thanks!

Last thing I'm curious about is #2:
> 2) Why does _close_mysql_link use efree(link) while
> _close_mysql_plink uses just free(link)?

Now that this destructor will actually be called, I'd hate for it to cause
some type of memory problem (of course, the destructor not being called at
all was actually an even bigger memory problem).




 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 23:01:31 2024 UTC