Bug #2955: Persistant Connection Gone Bad
| From: | dgarrett at acm dot org | Date: | Sat, 11 Dec 1999 01:17:54 +0000 |
| Subject: | Bug #2955: Persistant Connection Gone Bad | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13570@lists.php.net to get a copy of this message | ||
From: dgarrett@acm.org
Operating system: RedHat Linux 5.2, and 6.0
PHP version: 3.0.9
PHP Bug Type: PostgreSQL related
Bug description: Persistant Connection Gone Bad
On at least two servers which are running PHP 3.0.9 and 4.0 Beta 3 (respectively), persistant
database connections don't notice if the connection has been dropped.
This means that if you start the DB server, and then start the web server, when the connection is
established, everything is fine and dandy. If something happens to the connection (for example,
postgres is stopped and restarted) the web server keeps trying to use the connection.
It displays errors saying that the connection is dead, but keeps trying to reuse it anyway on
repeated loads of the page, anyway.
3 solutions present themselves to me.
Test the connection before giving it to the script. Seems best, but would involve extra overhead.
Automatically close and restart connections after certain types of errors. At least after the
scripts complete. This would allow errors to appear, but not continue to repeat indefinatly.
Reduce the value of 'MaxRequestsPerChild' in Apache, so the connections are not reused
for as lengthy a period. This avoids PHP changes, but reduces high load efficiency.