[SERVER-11019] Move static fromjson calls into MONGO_INITIALIZERS Created: 03/Oct/13  Updated: 10/Dec/14  Resolved: 02/Jun/14

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

Type: Improvement Priority: Minor - P4
Reporter: Shaun Verch Assignee: Unassigned
Resolution: Done Votes: 0
Labels: polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Want to only call fromjson in MONGO_INITIALIZERS so things like logging work. Right now enabling the debug logging in the json parser will cause startup to fail.



 Comments   
Comment by Eric Milkie [ 02/Jun/14 ]

Seems ok to do as you suggest.

Comment by Shaun Verch [ 02/Jun/14 ]

The reason I initially filed this ticket is because "fromjson" (the JSON parser) would use the logging framework when compiled with debug printouts, and at the time that would cause a crash when "fromjson" was called from a static context. I tested it with a recent version, and it now works, possibly because logging can now be used safely in a static context.

Given that, doing this may not have any value, and this work may be done as part of a larger refactor, such as SERVER-11919 or a similar ticket that has the potential to make "fromjson" no longer static context callable (although it's conceptually simple, so I see no reason why it shouldn't always be safe to call from a static context).

My recommendation, then, is to mark this as "Works As Designed" for now, since it's low value cleanup and will only come up again if someone is doing something to make the parser unsafe to call from a static context. matt.kangas@10gen.com and milkie, what do you think?

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