-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
ALL
Some initializers emitted by these macros are subtly incorrect.
- MONGO_STARTUP_OPTIONS_POST emits a function with the _Store suffix instead of _Post suffix as documented.
/** * Macro to define an initializer function named "<fname>_Post" ... */ #define MONGO_STARTUP_OPTIONS_POST(fname) \ fname##_Store, ("BeginPostStartupOptionStorage"), ("EndPostStartupOptionStorage"))
....
- Every phase has its own closed initializer range, after a Begin$X initializer and before an End$X initializer.
-#define MONGO_GENERAL_STARTUP_OPTIONS_REGISTER(fname) \ - MONGO_INITIALIZER_GENERAL(fname##_Register, \ - ("BeginGeneralStartupOptionRegistration"), \ - ("EndGeneralStartupOptionRegistration"))
But we seem to have flubbed the MONGO_MODULE_STARTUP_OPTIONS_REGISTER rule, which is defined to occur after EndGeneralStartupOptionRegistration and before EndStartupOptionRegistration, which is two "ends" and not its own well-defined interval. I'm not sure what the implications of this are but it doesn't appear to be intentional.
-#define MONGO_MODULE_STARTUP_OPTIONS_REGISTER(fname) \
- MONGO_INITIALIZER_GENERAL(fname##_Register, \
- ("EndGeneralStartupOptionRegistration"), \
- ("EndStartupOptionRegistration"))
We should emit these macros in a more structurally clear way. There's a lot of boilerplate in src/mongo/util/options_parser/startup_option_init.h that can be reduced.
- duplicates
-
SERVER-40811 Eliminate MONGO_INITIALIZER kruft
- Closed