Exception in MongoDB perl driver used under Mojolicious hypnotoad

154 views
Skip to first unread message

Cathe

unread,
Jul 2, 2014, 7:02:44 AM7/2/14
to mojol...@googlegroups.com
Hello,

The problem is exactly as it is described here: http://stackoverflow.com/questions/18140561/exceptions-in-mongodb-cursor-pm-line-161
Versions of MongoDB, MongoDB Perl driver are the most recent.

I suspect that something is wrong in the way how I connect to the mongodb: I do it from MyApp.pm before the startup { … } and it looks like connection is dropped sometimes (but not always) when hypnotoad restarts the workers, so they are forgetting about the connection.

I would be very grateful for your advice.

— Catherine.

Abhijit Menon-Sen

unread,
Jul 2, 2014, 7:31:41 AM7/2/14
to mojol...@googlegroups.com
At 2014-07-02 04:02:44 -0700, jes...@gmail.com wrote:
>
> The problem is exactly as it is described here:
> http://stackoverflow.com/questions/18140561/exceptions-in-mongodb-cursor-pm-line-161

Could you please include the question in your post, instead of just the
URL? (It's more convenient for some readers, and makes the archive more
useful to boot.)

Thanks.

-- ams

Per Carlson

unread,
Jul 2, 2014, 8:17:23 AM7/2/14
to mojolicious
Hi.
Have you read the guidelines in the wiki
(https://github.com/kraih/mojo/wiki/Using-mongodb)?

Cathe

unread,
Jul 4, 2014, 9:30:33 AM7/4/14
to mojol...@googlegroups.com
I'm sorry, this is the text (with correction for versions I use):

Using MongoDB 2.4.6 with version 0.704.1.0 of the Perl MongoDB driver, I frequently run into exceptions like these:

recv timed out (30000 ms) at ...MongoDB/Cursor.pm line 161.
couldn't get response to throw out at ...MongoDB/Cursor.pm line 161.
missed the response we wanted, please try again at ...MongoDB/Cursor.pm line 161
invalid header received at ...MongoDB/Cursor.pm line 161.
can't get db response, not connected at ...MongoDB/Cursor.pm line 161.

The exceptions are intermittent, and often vanish on the next request (this is a web app). Occasionally, the exceptions will persist over several consecutive requests.

Cathe

unread,
Jul 4, 2014, 9:32:34 AM7/4/14
to mojol...@googlegroups.com
Hi,

Thanks a lot! I couldn't find this guidance. I guess this is exactly what I need.

Cathe

unread,
Jan 1, 2015, 5:43:32 PM1/1/15
to mojol...@googlegroups.com
Hello again

I did everything as it as advised by the link above.
Didn't help actually.
May be this related to «Notes on Pooling for MongoDB Drivers» ( http://docs.mongodb.org/meta-driver/latest/legacy/notes-on-pooling-for-mongodb-drivers/ )
but I cannot get how to implement this with Mojolicious.

Sorry, but Perl driver for MongoDB is really erroneous and this happens already for years…

sri

unread,
Jan 1, 2015, 5:54:27 PM1/1/15
to mojol...@googlegroups.com
Sorry, but Perl driver for MongoDB is really erroneous and this happens already for years…

You might have more luck trying the official MongoDB support channels, this does not seem like a Mojolicious problem.

--
sebastian 

Cathe

unread,
Jan 5, 2015, 6:42:02 AM1/5/15
to mojol...@googlegroups.com
Hi Sebastian…

The thing is that apparently this issue happens after worker of hypnotoad is restarted, i.e. the corresponding processes (say I have only 1 worker) looks like that:
qapp   27672  0.0  0.9 243268 36004 ?        Ss   11:15   0:00 /net/qapp/live/app/script/sym
qapp   27688  0.4  1.1 251260 44256 ?        S    11:23   0:01 /net/qapp/live/app/script/sym

— 27688 was restarted at 11:23

and everything is fine when worker is running together with parent process:
qapp   27703  0.0  1.6 287576 63124 ?        Ss   11:29   0:00 /net/qapp/live/app/script/sym
qapp   27704  0.0  1.5 287708 62724 ?        S    11:29   0:00 /net/qapp/live/app/script/sym

I do not know why the worker has to be restarted and I have no control on this…

Cathe

unread,
Jan 5, 2015, 7:50:34 AM1/5/15
to mojol...@googlegroups.com
oops…
doesn't depend no workers restart really…
yes, apparently something wrong withenv setting on server and/or MongoDB

sri

unread,
Jan 5, 2015, 1:33:14 PM1/5/15
to mojol...@googlegroups.com
I do not know why the worker has to be restarted and I have no control on this…

This is factually incorrect, you have total control over the restart process.


It is enabled by default because in our experience, most non-trivial Perl applications leak memory, if they are not carefully reviewed and profiled.

--
sebastian
Reply all
Reply to author
Forward
0 new messages