assertion when querying

31 views
Skip to first unread message

Bhaskara Marthi

unread,
May 23, 2012, 7:31:26 PM5/23/12
to mongodb-user
Hi, I am using the C++ interface to query the db. The string
representation of my query is:

{ $query: { receipt_time: { $gt: 1335223509.0 } }, $orderby:
{ receipt_time: 1 } }

and it results in the client-side error below. The errors are
nondeterministic, but seem to occur about 10% of the time on that
query type. I'm using 2.0.5. Anyone know what this is?
- Bhaskara

Wed May 23 16:25:15 ERROR: MessagingPort::call() wrong id got:55
expect:54
toSend op: 2004
response msgid:951
response len: 115
response op: 1
remote: 127.0.0.1:27017
Wed May 23 16:25:15 ERROR: MessagingPort::call() wrong id got:54
expect:55
toSend op: 2004
response msgid:950
response len: 36
response op: 1
remote: 127.0.0.1:27017
Wed May 23 16:25:15 Assertion failure false util/net/
message_port.cpp 245
Wed May 23 16:25:15 Assertion failure false util/net/
message_port.cpp 245
0x7f23d1816ba3 0x7f23d18205ff 0x7f23d183f4fe 0x7f23d1857fe6
0x7f23d186eddb 0x7f23d184ca3a 0x7f23d185d5fa 0x7f23d1b1e5ea 0x4161c6
0x410d6a 0x411bed 0x41bbeb 0x7f23cbbdce3f 0x7f23cd6cec62
0x7f23cd6d5420 0x7f23cd6afcbe 0x7f23cd6d658f
0x7f23cd6b03ea 0x7f23cd6b0954
0x7f23cd34b569
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo12sayDbContextEPKc+0xc3) [0x7f23d1816ba3]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo8assertedEPKcS1_j+0xbf) [0x7f23d18205ff]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo13MessagingPort4recvERKNS_7MessageERS1_
+0x28e) [0x7f23d183f4fe]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo18DBClientConnection4callERNS_7MessageES2_bPSs
+0x46) [0x7f23d1857fe6]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo14DBClientCursor4initEv+0x9b)
[0x7f23d186eddb]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo12DBClientBase5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii
+0x2da) [0x7f23d184ca3a]
/u/bhaskara/dev/warehouse-fuerte/warehousewg/mongodb/mongo/lib64/
libmongoclient.so(_ZN5mongo18DBClientConnection5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii
+0x9a) [0x7f23d185d5fa]

Bhaskara Marthi

unread,
May 23, 2012, 7:50:33 PM5/23/12
to mongodb-user
I should add that I have multiple cursors open on the client side
doing queries (on different collections). Could that be related?
- b

Eliot Horowitz

unread,
May 24, 2012, 12:53:13 AM5/24/12
to mongod...@googlegroups.com
Are you using multiple threads?
Can you send the code?
Something looks not thread safe or something similar.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb

Bhaskara Marthi

unread,
May 24, 2012, 12:39:35 PM5/24/12
to mongodb-user


On May 23, 9:53 pm, Eliot Horowitz <el...@10gen.com> wrote:
> Are you using multiple threads?
> Can you send the code?
> Something looks not thread safe or something similar.
>
Hi Eliot, yes, it's using multiple threads, and your comment actually
prompted me to find the error. I had assumed all my queries were
happening in a certain thread, but this was not true for one of them.
I guess DBClientConnection itself is not threadsafe? Anyway, thanks
for the help!
- Bhaskara

Eliot Horowitz

unread,
May 24, 2012, 8:07:48 PM5/24/12
to mongod...@googlegroups.com
Correct. DBClientCursor is not thread safe.
Reply all
Reply to author
Forward
0 new messages