-
Type: Improvement
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.0.4
-
Component/s: Testing Infrastructure
-
None
-
Environment:Windows
-
Fully Compatible
Currently, StopMongoProgram() in shell_utils_launcher.cpp sends a SIGTERM on Linux, which shuts down the database cleanly.
On Windows, it actually connects to the database and attempts to issue a shutdown command. This can fail in a bunch of ways, and when that happens the shell calls TerminateProcess(), which shuts down the server uncleanly. This becomes a problem in unit tests where we need to be able to shut down the server cleanly and start it up again.
One way to improve this situation is to use Events. These can have the same semantics as UNIX signals; the main difference is that on Windows, you need to explicitly set up a listener ahead of time.
So in mongod, we will have a new thread that just calls CreateEvent() and then blocks in WaitForSingleObject(). After it unblocks, it simply calls dbexit().
In the shell, in the implementation of stopMongoProgram(), it will call OpenEvent() to open the same event that the mongod created and then call SetEvent() to signal it.
- duplicates
-
SERVER-12443 Skip mongos_rs_shard_failure_tolerance.js when running tests in --auth
- Closed
- is duplicated by
-
SERVER-5024 Fix shutdown method on ShardingTest to work with authentication on windows
- Closed
- is related to
-
SERVER-5405 mongos does not send reads to secondaries after replica restart when using keyFiles
- Closed