|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59460 MongoDB presist connection not stable
Submitted: 2010-10-13 12:13 UTC Modified: 2012-11-29 17:40 UTC
From: tomasen at gmail dot com Assigned: derick (profile)
Status: Closed Package: mongo (PECL)
PHP Version: PHP 5.3.3 OS: FreeBSD 7.1
Private report: No CVE-ID: None
 [2010-10-13 12:13 UTC] tomasen at gmail dot com
In fact I'm using PHP 5.3.3

persistent connections to mongodb doesn't seem to be stable enough. 

after few days, I encounter exception as "couldn't send query" and nothing works with mongodb. the serious problem is,  the connect doesn't seems to be able to fix or reconnect by itself.

After I change the persist connect key. or switch to non-persist connection, everything works.

maybe lack of automatic reconnection once break?
or meybe there can be too many opened persist connection to mongodb and exceed the limit

Reproduce code:
$m = new Mongo("mongodb:///tmp/mongodb-27017.sock", array("persist" => "anykey")); 

// anything operate data

Expected result:
 PHP Fatal error:  Uncaught exception 'MongoCursorException' with message 'couldn't send query.' in /data/www/2006/counter/jsc.php:39
Stack trace:
#0 /data/www/2006/counter/jsc.php(39): MongoCollection->findOne(Array, Array)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-13 12:15 UTC] tomasen at gmail dot com
trying to fix typo
 [2010-10-13 12:15 UTC] tomasen at gmail dot com
correct version info
 [2012-02-26 08:50 UTC]
-Package: PECL bug system +Package: mongo
 [2012-11-29 17:40 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

This should be fixed in the 1.3.0 release. If you continue finding problems with this, please file an issue in JIRA:
 [2012-11-29 17:40 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: derick
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Apr 10 23:01:24 2021 UTC