[SERVER-43063] Make the ServerParameterSet map non-leaky Created: 28/Aug/19  Updated: 27/Oct/23  Resolved: 26/Dec/19

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

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: DO NOT USE - Backlog - Dev Tools
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-43058 Allow the CatalogTestFixture to use t... Closed
related to SERVER-45307 Complete TODO listed in SERVER-43063 Closed
Assigned Teams:
Developer Tools
Participants:

 Description   

Right now we leak the map of server parameters contained inside the ServerParametersSet class leaks memory on shutdown. As far as I can tell, it is a global and currently implicitly leaked somehow without ASAN complaining.

-----------------------------
Why this was a problem:

We want to run WiredTiger in unit tests with higher level code. The setup of the WiredTigerKVEngine (the wt storage engine) requires manually setting up a couple server parameters here.

However, ASAN catches the memory leak in unit tests: it appears to be more strict in unit test binaries than the mongod binary.

--------------------------
Temporary solution added in SERVER-43058: we used __lsan_ignore_object on the server parameters set up in wiredtiger_init.cpp to quiet ASAN for the unit tests.



 Comments   
Comment by Eric Milkie [ 26/Dec/19 ]

I fixed the leak of the ServerParameters with SERVER-45288

Comment by Dianna Hohensee (Inactive) [ 10/Sep/19 ]

I've updated the description per what we ended up doing in SERVER-43058. We discovered that regardless of how we handled adding/removing to the global server params map and bypassing invariant checks, we fundamentally had a memory leak that unit tests did not appear to accept. Therefore we pivot'ed to quieting the ASAN error for the time building, to unblock work that was piling up behind getting the new unit tests working.

Comment by Billy Donahue [ 28/Aug/19 ]

The name forTesting could mean a lot of different behaviors. Let's put a hint in the name indicating what its implication is. Specifically that it is okay to re-add this ServerParameter to a ServerParameterSet.

I think maybe you don't need a ServerParameterSet::setTesting function. We can unconditionally disable the dupe check for any incoming ServerParameter that has been marked forTesting (or whatever that mark gets renamed to).

Generated at Thu Feb 08 05:02:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.