From 30126d08c8df852e641a7cff53fddc5f174dc428 Mon Sep 17 00:00:00 2001 From: Justin Dearing Date: Thu, 3 Jun 2010 05:06:51 +0800 Subject: [PATCH 1/7] Fixed mongod hanging when issuing a "mongod --remove" with the service running. If you attempted to remove the service while it was running, it would stop the service and hang in a while loop because a break statement was missing. Conflicts: util/ntservice.cpp --- util/ntservice.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/ntservice.cpp b/util/ntservice.cpp index ece3e4f553fe8..27f7857fad507 100644 --- a/util/ntservice.cpp +++ b/util/ntservice.cpp @@ -111,11 +111,14 @@ namespace mongo { SERVICE_STATUS serviceStatus; - // stop service if running + // stop service if its running if ( ::ControlService( schService, SERVICE_CONTROL_STOP, &serviceStatus ) ) { while ( ::QueryServiceStatus( schService, &serviceStatus ) ) { if ( serviceStatus.dwCurrentState == SERVICE_STOP_PENDING ) - Sleep( 1000 ); + { + Sleep( 1000 ); + } + else { break; } } } From 9ee37421cd2bb54215630b4cc7e4ed98f5dd5921 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Thu, 3 Jun 2010 12:54:38 -0400 Subject: [PATCH 2/7] freebsd fix? --- buildscripts/cleanbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py index a4b3597e3eeb2..e32f34b82da93 100644 --- a/buildscripts/cleanbb.py +++ b/buildscripts/cleanbb.py @@ -14,7 +14,7 @@ def shouldKill( c ): if c.find( cwd ) >= 0: return True - if c.find( "buildbot" ) >= 0 and c.find( "/mongo/" ) >= 0: + if ( c.find( "buildbot" ) >= 0 or c.find( "slave" ) ) and c.find( "/mongo/" ) >= 0: return True return False From 4cd8bf8291b0c6a195a62248cbf8715d72f29934 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 3 Jun 2010 13:08:28 -0400 Subject: [PATCH 3/7] Make mongoimport work w/o final EOL. SERVER-1152 --- tools/import.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/import.cpp b/tools/import.cpp index 58977c37146a7..de20fbb295e9d 100644 --- a/tools/import.cpp +++ b/tools/import.cpp @@ -224,10 +224,12 @@ class Import : public Tool { ProgressMeter pm( fileSize ); const int BUF_SIZE = 1024 * 1024 * 4; boost::scoped_array line(new char[BUF_SIZE+2]); - while ( *in ){ + while ( in->rdstate() == 0 ){ char * buf = line.get(); in->getline( buf , BUF_SIZE ); - uassert( 10263 , "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 ); + uassert( 10263 , "unknown error reading file" , + (!(in->rdstate() & ios_base::badbit)) && + (!(in->rdstate() & ios_base::failbit) || (in->rdstate() & ios_base::eofbit)) ); log(1) << "got line:" << buf << endl; while( isspace( buf[0] ) ) buf++; @@ -238,10 +240,6 @@ class Import : public Tool { buf[len+1] = 0; - if ( in->rdstate() == ios_base::eofbit ) - break; - assert( in->rdstate() == 0 ); - try { BSONObj o = parseLine( buf ); if ( _headerLine ){ From 79e9558062a2f17caafa7092bf0fd3df7f7520c4 Mon Sep 17 00:00:00 2001 From: Kenny Gorman Date: Fri, 4 Jun 2010 01:15:11 +0800 Subject: [PATCH 4/7] added flushes/s parameter. --- tools/stat.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/stat.cpp b/tools/stat.cpp index f72d61e99aa41..64f2c2f48b26e 100644 --- a/tools/stat.cpp +++ b/tools/stat.cpp @@ -136,7 +136,6 @@ namespace mongo { ss << setw(width) << val << " "; } - string doRow( const BSONObj& a , const BSONObj& b ){ stringstream ss; @@ -150,7 +149,14 @@ namespace mongo { } } - if ( b.getFieldDotted("mem.supported").trueValue() ){ + if ( b["backgroundFlushing"].type() == Object ){ + BSONObj ax = a["backgroundFlushing"].embeddedObject(); + BSONObj bx = b["backgroundFlushing"].embeddedObject(); + BSONObjIterator i( bx ); + cell( ss , "flushes/s" , 6 , (int)diff( "flushes" , ax , bx ) ); + } + + if ( b.getFieldDotted("mem.supported").trueValue() ){ BSONObj bx = b["mem"].embeddedObject(); BSONObjIterator i( bx ); cell( ss , "mapped" , 6 , bx["mapped"].numberInt() ); From 572c7439710663a5bdd7a7ecb62bb119aa59abbc Mon Sep 17 00:00:00 2001 From: Dwight Date: Thu, 3 Jun 2010 14:29:11 -0400 Subject: [PATCH 5/7] sconstruct cleaning mainly windows --- SConstruct | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index cd507892a9401..1928622846d8f 100644 --- a/SConstruct +++ b/SConstruct @@ -590,9 +590,10 @@ elif "win32" == os.sys.platform: boostLibs = [] - env.Append( CPPPATH=[ "js/src/" ] ) + env.Append(CPPPATH=[ "js/src/" ]) env.Append(CPPPATH=["../js/src/"]) env.Append(LIBPATH=["../js/src"]) + env.Append(LIBPATH=["../js/"]) env.Append( CPPDEFINES=[ "OLDJS" ] ) winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] , @@ -621,6 +622,7 @@ elif "win32" == os.sys.platform: env.Append( CPPFLAGS= " /O2 /MT /Gy /Zi /TP /errorReport:none " ) # TODO: this has caused some linking problems : # /GL whole program optimization + # /LTCG link time code generation env.Append( CPPFLAGS= " /GL " ) env.Append( LINKFLAGS=" /LTCG " ) else: @@ -631,7 +633,7 @@ elif "win32" == os.sys.platform: # RTC1 /GZ (Enable Stack Frame Run-Time Error Checking) env.Append( CPPFLAGS=" /Od /RTC1 /MDd /Zi /TP /errorReport:none " ) env.Append( CPPFLAGS=' /Fd"mongod.pdb" ' ) - env.Append( LINKFLAGS=" /incremental:yes /debug " ) + env.Append( LINKFLAGS=" /debug " ) if force64 and os.path.exists( boostDir + "/lib/vs2010_64" ): env.Append( LIBPATH=[ boostDir + "/lib/vs2010_64" ] ) @@ -642,7 +644,7 @@ elif "win32" == os.sys.platform: if force64: env.Append( LIBPATH=[ winSDKHome + "/Lib/x64" ] ) - env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " ) + #env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " ) else: env.Append( LIBPATH=[ winSDKHome + "/Lib" ] ) @@ -669,7 +671,10 @@ elif "win32" == os.sys.platform: winLibString = "ws2_32.lib kernel32.lib advapi32.lib Psapi.lib" if force64: - winLibString += " LIBCMT LIBCPMT " + + winLibString += "" + #winLibString += " LIBCMT LIBCPMT " + else: winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib " winLibString += " odbc32.lib odbccp32.lib uuid.lib " @@ -930,7 +935,16 @@ def doConfigure( myenv , needPcre=True , shell=False ): if usesm: - myCheckLib( [ "mozjs" , "js", "js_static" ] , True ) + # see http://www.mongodb.org/pages/viewpageattachments.action?pageId=12157032 + J = [ "mozjs" , "js", "js_static" ] + if windows and msarch == "amd64": + if release: + J = [ "js64r", "js", "mozjs" , "js_static" ] + else: + J = "js64d" + print( "will use js64d.lib for spidermonkey. (available at mongodb.org prebuilt.)" ); + + myCheckLib( J , True ) mozHeader = "js" if bigLibString(myenv).find( "mozjs" ) >= 0: mozHeader = "mozjs" From 0ad4e0a9e8beda460eda9272d0a4bd8498cf0f76 Mon Sep 17 00:00:00 2001 From: Dwight Date: Thu, 3 Jun 2010 14:35:13 -0400 Subject: [PATCH 6/7] shouldnt have to define too many macros in the make files --- pch.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pch.h b/pch.h index f50c750b4d9cb..f726bc05c0c6c 100644 --- a/pch.h +++ b/pch.h @@ -20,6 +20,10 @@ #pragma once +#if defined(MONGO_EXPOSE_MACROS) +#define JS_C_STRINGS_ARE_UTF8 +#endif + #if defined(_WIN32) # define NOMINMAX # include //this must be included before the first windows.h include From 2fb5ba7c3157bbbe3dc615b58f7f8a69d9bebfdb Mon Sep 17 00:00:00 2001 From: Dwight Date: Thu, 3 Jun 2010 14:42:31 -0400 Subject: [PATCH 7/7] fix decltype for windows for spidermonkey --- scripting/engine_spidermonkey.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/engine_spidermonkey.h b/scripting/engine_spidermonkey.h index 4e420de7f2602..4617b5d878f4d 100644 --- a/scripting/engine_spidermonkey.h +++ b/scripting/engine_spidermonkey.h @@ -37,7 +37,7 @@ #include "jstypes.h" #undef JS_PUBLIC_API #undef JS_PUBLIC_DATA -#define JS_PUBLIC_API(t) t +#define JS_PUBLIC_API(t) t __cdecl #define JS_PUBLIC_DATA(t) t #endif