[SERVER-5651] Better implementation of Windows server shutdown Created: 19/Apr/12 Updated: 11/Jul/16 Resolved: 31/Dec/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | 2.5.5 |
| Type: | Improvement | Priority: | Critical - P2 |
| Reporter: | Eric Milkie | Assignee: | Mark Benvenuto |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Currently, StopMongoProgram() in shell_utils_launcher.cpp sends a SIGTERM on Linux, which shuts down the database cleanly. 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. |
| Comments |
| Comment by Githook User [ 02/Jan/14 ] |
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: |
| Comment by Githook User [ 31/Dec/13 ] |
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: |
| Comment by Randolph Tan [ 19/Apr/12 ] |
|
One example of a failure scenario is when the mongod is authenticated and since the shutdown command requires admin priviledge, stopMongod won't be able to shut the server down with anything other than SIG_KILL. |