Andrew Kryczka e18a4df62a workaround race conditions during PeriodicWorkScheduler registration (#7888)
Summary:
This provides a workaround for two race conditions that will be fixed in
a more sophisticated way later. This PR:

(1) Makes the client serialize calls to `Timer::Start()` and `Timer::Shutdown()` (see https://github.com/facebook/rocksdb/issues/7711). The long-term fix will be to make those functions thread-safe.
(2) Makes `PeriodicWorkScheduler` atomically add/cancel work together with starting/shutting down its `Timer`. The long-term fix will be for `Timer` API to offer more specialized APIs so the client will not need to synchronize.

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

Test Plan: ran the repro provided in https://github.com/facebook/rocksdb/issues/7881

Reviewed By: jay-zhuang

Differential Revision: D25990891

Pulled By: ajkr

fbshipit-source-id: a97fdaebbda6d7db7ddb1b146738b68c16c5be38
2021-01-21 08:50:38 -08:00
..
2017-07-15 16:11:23 -07:00
2020-10-28 23:22:27 -07:00
2020-04-20 13:24:25 -07:00
2020-11-10 23:42:13 -08:00
2020-10-01 09:23:04 -07:00
2020-04-20 13:24:25 -07:00
2020-07-09 14:35:17 -07:00
2020-07-09 14:35:17 -07:00
2020-10-28 23:22:27 -07:00
2017-07-15 16:11:23 -07:00
2020-10-01 09:23:04 -07:00
2020-10-28 23:22:27 -07:00