rocksdb/port/win
Zichen Zhu 65893ad959 Explicitly closing all directory file descriptors (#10049)
Summary:
Currently, the DB directory file descriptor is left open until the deconstruction process (`DB::Close()` does not close the file descriptor). To verify this, comment out the lines between `db_ = nullptr` and `db_->Close()` (line 512, 513, 514, 515 in ldb_cmd.cc) to leak the ``db_'' object, build `ldb` tool and run
```
strace --trace=open,openat,close ./ldb --db=$TEST_TMPDIR --ignore_unknown_options put K1 V1 --create_if_missing
```
There is one directory file descriptor that is not closed in the strace log.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10049

Test Plan: Add a new unit test DBBasicTest.DBCloseAllDirectoryFDs: Open a database with different WAL directory and three different data directories, and all directory file descriptors should be closed after calling Close(). Explicitly call Close() after a directory file descriptor is not used so that the counter of directory open and close should be equivalent.

Reviewed By: ajkr, hx235

Differential Revision: D36722135

Pulled By: littlepig2013

fbshipit-source-id: 07bdc2abc417c6b30997b9bbef1f79aa757b21ff
2022-06-01 18:03:34 -07:00
..
env_default.cc Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
env_win.cc Explicitly closing all directory file descriptors (#10049) 2022-06-01 18:03:34 -07:00
env_win.h Added GetFactoryCount/Names/Types to ObjectRegistry (#9358) 2022-05-16 09:44:43 -07:00
io_win.cc Explicitly closing all directory file descriptors (#10049) 2022-06-01 18:03:34 -07:00
io_win.h Explicitly closing all directory file descriptors (#10049) 2022-06-01 18:03:34 -07:00
port_win.cc Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
port_win.h Remove code that only compiles for Visual Studio versions older than 2015 (#10065) 2022-05-26 16:55:08 -07:00
win_jemalloc.cc Remove code that only compiles for Visual Studio versions older than 2015 (#10065) 2022-05-26 16:55:08 -07:00
win_logger.cc Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
win_logger.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
win_thread.cc Fix incorrect order of comments in win_thread.cc (#9033) 2021-10-27 13:25:01 -07:00
win_thread.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
xpress_win.cc Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00
xpress_win.h Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00