Is timeout correct?

67 views
Skip to first unread message

Jianjun Mao

unread,
Aug 23, 2016, 9:15:25 AM8/23/16
to mgo-users
Hi,

By default, mgo.Dial will set socket timeout with 60 seconds. But why my query returned read tcp timeout after 10 seconds ?
I use a fixed size session pool to do query, I don't know if there's something related to the reusing socket mechanism.
Can anyone explain this?
Thanks.

Gustavo Niemeyer

unread,
Aug 23, 2016, 11:24:30 AM8/23/16
to mgo-...@googlegroups.com
Hi Jianjun,

Per the documentation at http://gopkg.in/mgo.v2#Dial:

"Dial will timeout after 10 seconds if a server isn't reached."

--
You received this message because you are subscribed to the Google Groups "mgo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mgo-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jianjun Mao

unread,
Aug 23, 2016, 10:01:39 PM8/23/16
to mgo-users
Thanks for your reply.

I'm sorry for lack of error message.
The error is 'read tcp <ip>:20973-><ip>:7017: i/o timeout'  which is return by the Find().All() query command.


On Tuesday, August 23, 2016 at 11:24:30 PM UTC+8, Gustavo Niemeyer wrote:
Hi Jianjun,

Per the documentation at http://gopkg.in/mgo.v2#Dial:

"Dial will timeout after 10 seconds if a server isn't reached."
On Tue, Aug 23, 2016 at 10:15 AM, Jianjun Mao <justm...@gmail.com> wrote:
Hi,

By default, mgo.Dial will set socket timeout with 60 seconds. But why my query returned read tcp timeout after 10 seconds ?
I use a fixed size session pool to do query, I don't know if there's something related to the reusing socket mechanism.
Can anyone explain this?
Thanks.

--
You received this message because you are subscribed to the Google Groups "mgo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mgo-users+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Gustavo Niemeyer

unread,
Aug 23, 2016, 11:44:18 PM8/23/16
to mgo-...@googlegroups.com
Can you please send a small reproducer example?  It needs to be self-contained so I can test it locally.

To unsubscribe from this group and stop receiving emails from it, send an email to mgo-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jianjun Mao

unread,
Sep 1, 2016, 11:50:39 PM9/1/16
to mgo-users
It's really hard to reproduce with small example...
Strange timeout seems disappeared after I upgrade labix.org/v2/mgo (2013) to gopkg.in/mgo.v2 (2015-06)...
The server version is 3.0.5 and deployed with mongo sharding.
Reply all
Reply to author
Forward
0 new messages