[SERVER-5520] Shutdown rewrite (tracking ticket) Created: 05/Apr/12 Updated: 17/Mar/17 Resolved: 17/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Ian Whalen (Inactive) | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | tracking-ticket | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Description |
|
This ticket is the dual of The shutdown process needs similar attention. There is some "shutdown" code that needs to be run when the server is shutting down. However, this code is often run implicitly in destructors, or is lumped all together with process exit. To start, we have duplicated definitions of the "dbexit" function, which is the entry point to the shutdown system. One for mongos: This function is the entry to point to the current shutdown process in the server. The fact that these signatures are identical (and used from some libraries that both mongod and mongos share) and have diverged shows that the shutdown process has not been properly factored out. "server.cpp" is the main() for mongos, and "instance.cpp" is a legacy file with old file and process related code. There is also an "inShutdown" function, of which there are also multiple definitions: mongod: This function is effectively in place as a way to notify other parts of the server that we are shutting down. However, this function is not thread safe, and it is not clear when this call is needed. This could potentially be replaced by some more explicit notification of the various components that need to be notified of shutdown. Finally, the "dbexit" call, in addition to shutting down the database components, also exits the process. This lack of separation is a problem specifically for the tools, since some tools internally start up a database server to enable the "--dbpath" direct data file access functionality. This means that when the server gets shut down, the process exits which means the tools have limited control over how the process exits in this case. See |
| Comments |
| Comment by Githook User [ 16/Oct/14 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by Githook User [ 29/Sep/14 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by Githook User [ 29/Sep/14 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by auto [ 30/Apr/12 ] |
|
Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: Do not call dbexit() from within logRotate or initLogging(). While, perhaps, not a permanent solution, using fassert() when log rotation fails is a better See |
| Comment by auto [ 30/Apr/12 ] |
|
Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: Stop using mongo::dbexit() in malloc/realloc out-of-memory situations. This is only marginally better, but is a stop gap pending a fuller startup/shutdown See |
| Comment by auto [ 27/Apr/12 ] |
|
Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: Remove code that has been dead since commit in June 2011. Removes from consideration a dbexit(), so relevant to Commit in question: 759e1e646df90b5ac858e2ccd6d587ef59912353 |
| Comment by auto [ 25/Apr/12 ] |
|
Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: ntservice needs to call exitCleanly(), not dbexit().
|
| Comment by auto [ 25/Apr/12 ] |
|
Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: Limit exitCleanly() and ntservice module to mongos and mongod. The notions of exitCleanly() versus dbexit() vs _exit() in the scope of mongod
|