0
votes

I'm running a Rackspace cloud server CentOs + apache2 + php 5.4 + pcntl module with a basic Kohana php framework with a mongoDb task module that forks children processes. I get the following error if I try to run more then 1 child task process at the same time:

Unable to connect to MongoDB server at Interrupted system call

According to the mongoDb task module author the issue is not related to code but perhaps the mongoDb driver or the server.

Does anyone know what the error means and/or what may be the cause?

Full error output:

0 /var/www/.../modules/mangodb/classes/mangodb.php(370): MangoDB->connect()

1 /var/www/.../modules/mangodb/classes/mangodb.php(173): MangoDB->_call('command', Array, Array)

2 /var/www/.../modules/mangotask/classes/model/queue/task.php(33): MangoDB->command(Array)

3 /var/www/.../modules/mangoQueue/classes/controller/daemon.php(232): Model_Queue_Task->get_next()

4 /var/www/.../modules/mangoQueue/classes/controller/daemon.php(111): Controller_Daemon->daemon()

5 [internal function]: Controller_Daemon->action_index()

6 /var/www/.../system/classes/kohana/request/client/internal.php(118): reflectionMethod->invoke(Object(Controller_Daemon))

7 /var/www/.../system/classes/kohana/request/client.php(64): Kohana_Request_Client_Internal->execute_request(Object(Request))

8 /var/www/.../system/classes/kohana/request.php(1138): Kohana_Request_Client->execute(Object(Request))

9 /var/www/.../index.php(109): Kohana_Request->execute()

1

1 Answers

0
votes

Driver version 1.2.12 definitely has issues with forking, but this is something that should be resolved in the forthcoming 1.3.0 release. In particular, PHP-426 is one of the later issues to address this problem, as it relocated connection selection from MongoCursor to MongoCursor::doQuery(), allowing the driver to operate correctly after a fork. I would keep an eye out for the next 1.3.0 pre-release (either beta3 or rc1), and certainly when the final 1.3.0 version is released via http://pecl.php.net/package/mongo.