[SERVER-1346] map reduce database exits out Created: 01/Jul/10  Updated: 12/Jul/16  Resolved: 02/Jul/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.4

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

See log below. My guess from quick look at the code is when reduceFinal() throws an exception the YieldLock isn't cleaned up properly and the assert() in ~YieldLock() is the default assert() not mongo assert()

ClientCursor::YieldLock yield (cursor.get());

state.finalReduce( all );

all.clear();
prev = o;
all.push_back( o );

if ( ! yield.stillOk() )

{ cursor.release(); break; }

killCurrentOp.checkForInterrupt();

Thu Jul 1 13:21:07 JS Error: ReferenceError: google_re_sd is not defined nofile_b:4
Thu Jul 1 13:21:07 webtrafficaggdb.rawDayTraffic Assertion failure ! _unlock db/clientcursor.h 167
Thu Jul 1 13:21:07 terminate() called, printing stack:
0x515713 0x51fa4f 0x6e443b 0x6e8682 0x718571 0x719325 0x5b7665 0x5bbf02 0x68f64a 0x6944b1 0x74c8ed 0x75f610 0x3586617 0x35874d3c2d
/usr/bin/mongod(_ZN5mongo12sayDbContextEPKc+0xb3) [0x515713]
/usr/bin/mongod(_ZN5mongo8assertedEPKcS1_j+0x10f) [0x51fa4f]
/usr/bin/mongod(_ZN5mongo12ClientCursor9YieldLockD1Ev+0x9b) [0x6e443b]
/usr/bin/mongod(_ZN5mongo2mr16MapReduceCommand3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x33a2) [0x6e8682]
/usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x661) [18571]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x6b5) [0x71932
/usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x35)x5b7665]
/usr/bin/mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x27c2) [0x5bbf02]
/usr/bin/mongod [0x68f64a]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x1271) [0x6944b1]
/usr/bin/mongod(_ZN5mongo10connThreadEv+0x30d) [0x74c8ed]
/usr/bin/mongod(thread_proxy+0x80) [0x75f610]
/lib64/libpthread.so.0 [0x3587c06617]
/lib64/libc.so.6(clone+0x6d) [0x35874d3c2d]
0x74a1e0 0x358bcbcdb6 0x358bcbc16b 0x358bcbcc43 0x35898088e8 0x3589808c5a 0x6e44c5 0x6e8682 0x718571 0x719325 0x565 0x5bbf02 0x68f64a 0x6944b1 0x74c8ed 0x75f610 0x3587c06617 0x35874d3c2d
/usr/bin/mongod(_ZN5mongo11myterminateEv+0x50) [0x74a1e0]
/usr/lib64/libstdc++.so.6 [0x358bcbcdb6]
/usr/lib64/libstdc++.so.6 [0x358bcbc16b]
/usr/lib64/libstdc++.so.6(__gxx_personality_v0+0x353) [0x358bcbcc43]
/lib64/libgcc_s.so.1 [0x35898088e8]
/lib64/libgcc_s.so.1(_Unwind_Resume+0x9a) [0x3589808c5a]
/usr/bin/mongod(_ZN5mongo12ClientCursor9YieldLockD1Ev+0x125) [0x6e44c5]
/usr/bin/mongod(_ZN5mongo2mr16MapReduceCommand3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x33a2) [0x6e8682]
/usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x661) [18571]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x6b5) [0x71932
/usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x35)x5b7665]
/usr/bin/mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x27c2) [0x5bbf02]
/usr/bin/mongod [0x68f64a]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x1271) [0x6944b1]
/usr/bin/mongod(_ZN5mongo10connThreadEv+0x30d) [0x74c8ed]
/usr/bin/mongod(thread_proxy+0x80) [0x75f610]
/lib64/libpthread.so.0 [0x3587c06617]
/lib64/libc.so.6(clone+0x6d) [0x35874d3c2d]
Thu Jul 1 13:21:07 Got signal: 6 (Aborted).
Thu Jul 1 13:21:07 Backtrace:
0x74a849 0x35874302d0 0x3587430265 0x3587431d10 0x74a29f 0x358bcbcdb6 0x358bcbc16b 0x358bcbcc43 0x35898088e8 0x3508c5a 0x6e44c5 0x6e8682 0x718571 0x719325 0x5b7665 0x5bbf02 0x68f64a 0x6944b1 0x74c8ed 0x75f610
/usr/bin/mongod(_ZN5mongo10abruptQuitEi+0x399) [0x74a849]
/lib64/libc.so.6 [0x35874302d0]
/lib64/libc.so.6(gsignal+0x35) [0x3587430265]
/lib64/libc.so.6(abort+0x110) [0x3587431d10]
/usr/bin/mongod(_ZN5mongo11myterminateEv+0x10f) [0x74a29f]
/usr/lib64/libstdc++.so.6 [0x358bcbcdb6]
/usr/lib64/libstdc++.so.6 [0x358bcbc16b]
/usr/lib64/libstdc++.so.6(__gxx_personality_v0+0x353) [0x358bcbcc43]
/lib64/libgcc_s.so.1 [0x35898088e8]
/lib64/libgcc_s.so.1(_Unwind_Resume+0x9a) [0x3589808c5a]
/usr/bin/mongod(_ZN5mongo12ClientCursor9YieldLockD1Ev+0x125) [0x6e44c5]
/usr/bin/mongod(_ZN5mongo2mr16MapReduceCommand3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x33a2) [0x6e8682]
/usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x661) [18571]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x6b5) [0x71932
/usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x35)x5b7665]
/usr/bin/mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x27c2) [0x5bbf02]
/usr/bin/mongod [0x68f64a]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x1271) [0x6944b1]
/usr/bin/mongod(_ZN5mongo10connThreadEv+0x30d) [0x74c8ed]
/usr/bin/mongod(thread_proxy+0x80) [0x75f610]
Thu Jul 1 13:21:07 dbexit:
Thu Jul 1 13:21:07 shutdown: going to close listening sockets...
Thu Jul 1 13:21:07 going to close listening socket: 5
Thu Jul 1 13:21:07 going to close listening socket: 6
Thu Jul 1 13:21:07 going to close listening socket: 7
Thu Jul 1 13:21:07 going to close listening socket: 8
Thu Jul 1 13:21:07 shutdown: going to flush oplog...
Thu Jul 1 13:21:07 shutdown: going to close sockets...
Thu Jul 1 13:21:07 shutdown: waiting for fs preallocator...
Thu Jul 1 13:21:07 shutdown: closing all files...
Thu Jul 1 13:21:07 closeAllFiles() finished
Thu Jul 1 13:21:07 shutdown: removing fs lock...
Thu Jul 1 13:21:07 dbexit: really exiting now
ERROR: Client::~Client _context should be NULL: conn



 Comments   
Comment by auto [ 02/Jul/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: fix recursive throw in mr SERVER-1346
http://github.com/mongodb/mongo/commit/b962be5964672b689c00506d8e8b56de30415bb1

Comment by Aaron Staple [ 02/Jul/10 ]

So - looking more carefully it is a mongo assert not a regular assert. The mongo assert is throwing an exception inside a destructor which is being called as a result of another exception. Because there are two exceptions, c++ terminates.

Comment by Eliot Horowitz (Inactive) [ 02/Jul/10 ]

I was referring to
assert() in ~YieldLock() is the default assert() not mongo assert()

we should always be calling the mongo assert, not the standard system assert.

Comment by Aaron Staple [ 02/Jul/10 ]

not sure if I understand what you are asking - finalReduce calls reduceValues which calls invokeSafe which throws an exception if there's a js error.

Comment by Eliot Horowitz (Inactive) [ 02/Jul/10 ]

We should absolutely never call a regular assert, so can you check that first?

Generated at Thu Feb 08 02:56:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.