-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
We msync() without the MongoFiles lock, so it's possible for things to be closed out from under us. When msync() fails, we go to check to see if our MongoFile is still valid and if not, we ignore the msync error.
The way we check if the file is still valid is by checking to see if the pointer value still exists in the std::set of MongoFiles. This check is flawed because it's possible to have a MongoFile be destroyed and then have a new one created with the same address.
To ensure MongoFile uniqueness, we can embed a unique value (by using an AtomicInt counter) that we can use to compare.