[SERVER-5211] Refactor CmdLine::store Created: 05/Mar/12  Updated: 11/Jul/16  Resolved: 10/Oct/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.0

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Andy Schwerin
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-5115 Service install with just a config fi... Closed
is related to SERVER-5186 When mongod --shutdown is issued, an ... Closed
is related to SERVER-5187 mongod --shutdown flag should ignore ... Closed
Participants:

 Description   

We should split it into two steps. store() should only store the options, but not act on them. A new function process() should act on them. Currently it is hard to get a holistic view of all options because things like --fork and --logpath modify the running state before we can intercept. This is particularly a problem for --shutdown, but there are other cases where it would be nice to have a step between reading the config and acting on it.



 Comments   
Comment by auto [ 10/Oct/12 ]

Author:

{u'date': u'2012-10-08T11:18:02-07:00', u'email': u'schwerin@10gen.com', u'name': u'Andy Schwerin'}

Message: SERVER-5211 Separate of CmdLine::store into two functions.

The new functions are CmdLine::store, with the same signature as before, and
mongo::initializeServerGlobalState(), which should take no parameters, but does
take an optional bool to deal with a knot in mongod --shutdown that I haven't
yet untangled.

This separation makes it easier to test functions in the command line parsing
part of the library, and provides a little extra clarity on the role of the two
functions.
Branch: master
https://github.com/mongodb/mongo/commit/f0a5062ff9651f97ac58ef1f50f91b0a5f653798

Comment by auto [ 10/Oct/12 ]

Author:

{u'date': u'2012-10-08T14:47:37-07:00', u'email': u'schwerin@10gen.com', u'name': u'Andy Schwerin'}

Message: SERVER-5211 Move prettyHostName() into mongo/util/net/sock.

{h,cpp}

.
Branch: master
https://github.com/mongodb/mongo/commit/a73ff022bf8941d1ca6cf1d71ee6163aa17dcd52

Comment by auto [ 10/Oct/12 ]

Author:

{u'date': u'2012-10-04T15:59:22-07:00', u'email': u'schwerin@10gen.com', u'name': u'Andy Schwerin'}

Message: SERVER-5211 Fix up includes in cmdline.h, and stop "using namespace std" therein.
Branch: master
https://github.com/mongodb/mongo/commit/f1c121556b9c72127f0902314cd43a63fdf6c905

Comment by Tad Marshall [ 05/Mar/12 ]

It is both convenient and a problem that CmdLine::store does so much. A connected issue (like --shutdown) is the set of Windows service-related command line options that should never appear in a config file. We need a way of flagging options by source.

Generated at Thu Feb 08 03:08:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.