Skip to content

Commit

Permalink
SERVER-5073 fix failing test in 32-bit Windows
Browse files Browse the repository at this point in the history
Use the "force" option in the Windows version's kill_wrapper()
routine (called by the StopMongoProgram() and related shell
commands) so we can shut down a replica set primary after we have
shut down the secondaries.  Increase the timeout before using the
Windows TerminateProcess() API from 30 seconds to 60 seconds to
reduce the window for a race.
  • Loading branch information
Tad Marshall committed Feb 24, 2012
1 parent f8eee92 commit 0d67a47
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mongo/shell/shell_utils.cpp
Expand Up @@ -743,7 +743,11 @@ namespace mongo {
DBClientConnection conn;
try {
conn.connect("127.0.0.1:" + BSONObjBuilder::numStr(port));
conn.simpleCommand("admin", NULL, "shutdown");
BSONObj info;
BSONObjBuilder b;
b.append( "shutdown", 1 );
b.append( "force", 1 );
conn.runCommand( "admin", b.done(), info );
}
catch (...) {
//Do nothing. This command never returns data to the client and the driver doesn't like that.
Expand Down Expand Up @@ -781,7 +785,7 @@ namespace mongo {

int i = 0;
for( ; i < 130; ++i ) {
if ( i == 30 ) {
if ( i == 60 ) {
char now[64];
time_t_to_String(time(0), now);
now[ 20 ] = 0;
Expand Down

0 comments on commit 0d67a47

Please sign in to comment.