rocksdb/env
Cheng Chang 46516778dd Fix flaky test DecreaseNumBgThreads (#6393)
Summary:
The DecreaseNumBgThreads test keeps failing on Windows in AppVeyor.
It fails because it depends on a timed wait for the tasks to be dequeued from the threadpool's internal queue, but within the specified time, the task might have not been scheduled onto the newly created threads.
https://github.com/facebook/rocksdb/pull/6232 tries to fix this by waiting for longer time to let the threads scheduled.
This PR tries to fix this by replacing the timed wait with a synchronization on the task's internal conditional variable.
When the number of threads increases, instead of guessing the time needed for the task to be scheduled, it directly blocks on the conditional variable until the task starts running.
But when thread number is reduced, it still does a timed wait, but this does not lead to the flakiness now, will try to remove these timed waits in a future PR.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6393

Test Plan: Wait to see whether AppVeyor tests pass.

Differential Revision: D19890928

Pulled By: cheng-chang

fbshipit-source-id: 4e56e4addf625c98c0876e62d9d57a6f0a156f76
2020-02-13 17:27:18 -08:00
..
composite_env_wrapper.h Fix some shadow warning (#6242) 2020-01-08 18:20:13 -08:00
env.cc Consolidate ReadFileToString() (#6366) 2020-02-04 11:39:23 -08:00
env_basic_test.cc The ObjectRegistry class replaces the Registrar and NewCustomObjects.… (#5293) 2019-07-23 17:13:05 -07:00
env_chroot.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_chroot.h Change RocksDB License 2017-07-15 16:11:23 -07:00
env_encryption.cc Fix EncryptedEnv assert (#5735) 2019-09-05 17:21:42 -07:00
env_hdfs.cc Fix compilation with USE_HDFS (#5444) 2019-06-18 14:55:59 -07:00
env_posix.cc Fix unity test (#6178) 2019-12-14 15:39:41 -08:00
env_test.cc Fix flaky test DecreaseNumBgThreads (#6393) 2020-02-13 17:27:18 -08:00
file_system.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
fs_posix.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
io_posix.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
io_posix.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
mock_env.cc Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
mock_env.h Update all unique/shared_ptr instances to be qualified with namespace std (#4638) 2018-11-09 11:19:58 -08:00
mock_env_test.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00