Yueh-Hsuan Chiang
00d6edf6a0
Ensure the destruction order of PosixEnv and ThreadLocalPtr
...
Summary:
By default, RocksDB initializes the singletons of ThreadLocalPtr first, then initializes PosixEnv
via static initializer. Destructor terminates objects in reverse order, so terminating PosixEnv
(calling pthread_mutex_lock), then ThreadLocal (calling pthread_mutex_destroy).
However, in certain case, application might initialize PosixEnv first, then ThreadLocalPtr.
This will cause core dump at the end of the program (eg. https://github.com/facebook/mysql-5.6/issues/122 )
This patch fix this issue by ensuring the destruction order by moving the global static singletons
to function static singletons. Since function static singletons are initialized when the function is first
called, this property allows us invoke to enforce the construction of the static PosixEnv and the
singletons of ThreadLocalPtr by calling the function where the ThreadLocalPtr singletons belongs
right before we initialize the static PosixEnv.
Test Plan: Verified in the MyRocks.
Reviewers: yoshinorim, IslamAbdelRahman, rven, kradhakrishnan, anthony, sdong, MarkCallaghan
Reviewed By: anthony
Subscribers: dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D51789
2015-12-11 00:21:58 -08:00
..
2015-09-11 17:36:48 -07:00
2014-12-02 12:09:20 -08:00
2015-09-14 11:54:47 -07:00
2015-09-25 13:55:11 -07:00
2015-09-28 11:51:32 -07:00
2015-10-29 18:07:37 -07:00
2015-10-29 18:07:37 -07:00
2015-10-29 18:07:37 -07:00
2015-06-18 15:58:00 -07:00
2015-07-13 13:50:18 -07:00
2015-09-15 18:10:36 -07:00
2015-04-25 18:14:27 +09:00
2015-02-19 13:11:10 -08:00
2014-11-07 15:04:30 -08:00
2015-06-19 09:43:08 -07:00
2015-12-04 15:12:07 -08:00
2015-07-02 11:35:51 -07:00
2015-03-17 14:08:00 -07:00
2014-08-19 06:48:21 -07:00
2015-11-24 16:33:09 +03:00
2015-09-14 12:42:06 -07:00
2015-09-08 15:30:49 -07:00
2015-12-09 14:06:23 -08:00
2015-03-17 14:08:00 -07:00
2015-07-10 17:59:36 -07:00
2015-07-10 17:59:36 -07:00
2015-09-16 11:31:45 -07:00
2014-11-13 14:39:30 -05:00
2015-08-19 15:02:17 -07:00
2015-08-19 15:02:17 -07:00
2015-09-28 15:58:50 -07:00
2015-09-15 18:10:36 -07:00
2014-12-02 12:09:20 -08:00
2015-07-07 16:58:20 -07:00
2015-10-01 08:29:31 +13:00
2015-12-11 00:21:58 -08:00
2015-11-10 17:03:42 -08:00
2015-11-16 12:56:21 -08:00
2015-03-17 14:08:00 -07:00
2015-05-21 15:39:30 -07:00
2015-07-17 10:07:40 -07:00
2015-11-10 17:03:42 -08:00
2015-11-10 17:03:42 -08:00
2015-11-10 17:03:42 -08:00
2015-10-19 13:40:44 -07:00
2015-08-19 15:02:17 -07:00
2015-03-17 14:08:00 -07:00
2013-10-16 17:48:41 -07:00
2014-11-11 16:47:22 -05:00
2014-11-20 10:49:32 -08:00
2015-07-16 11:22:21 +02:00
2015-07-15 03:34:40 -07:00
2015-04-25 18:14:27 +09:00
2015-10-14 16:08:55 -07:00
2015-07-13 13:50:18 -07:00
2015-10-13 10:41:48 -07:00
2015-02-04 21:39:45 -08:00
2015-11-10 17:03:42 -08:00
2015-11-10 17:03:42 -08:00
2015-06-12 10:45:02 -07:00
2015-08-13 16:52:26 -07:00
2015-10-16 14:10:33 -07:00
2015-07-07 16:58:20 -07:00
2015-07-01 16:13:56 -07:00
2014-05-09 08:41:02 -07:00
2015-03-30 11:28:25 -07:00
2015-03-30 11:28:25 -07:00
2015-07-20 17:20:40 -07:00
2015-09-11 09:57:02 -07:00
2015-07-20 17:20:40 -07:00
2015-09-11 09:57:02 -07:00
2015-08-12 10:18:59 -07:00
2013-10-16 17:48:41 -07:00
2014-11-11 16:47:22 -05:00
2015-12-09 18:22:45 -08:00
2015-12-09 18:22:45 -08:00
2014-06-16 15:41:46 -07:00
2015-11-24 16:33:09 +03:00
2015-12-09 18:22:45 -08:00
2015-12-09 18:22:45 -08:00
2015-12-08 17:01:02 -08:00
2015-11-12 06:52:43 -08:00
2015-11-04 18:53:30 -08:00
2015-11-04 21:02:20 -08:00
2015-11-17 17:09:49 -08:00
2015-12-09 18:22:45 -08:00
2015-10-13 10:41:48 -07:00
2015-10-07 11:23:20 -07:00
2015-07-01 16:13:56 -07:00
2015-07-01 16:13:56 -07:00
2015-06-02 02:07:58 -07:00
2015-07-07 16:58:20 -07:00
2015-11-10 16:41:23 -08:00
2015-11-10 16:41:23 -08:00
2015-03-18 15:35:55 -07:00
2015-07-01 16:13:56 -07:00
2015-09-03 17:00:09 -07:00
2015-11-24 15:16:02 -08:00
2015-03-17 14:08:00 -07:00
2015-10-02 15:35:32 -07:00
2015-09-15 10:52:00 -07:00
2015-08-05 20:05:56 -07:00
2015-08-31 16:13:29 -07:00
2015-08-31 16:13:29 -07:00
2015-10-07 09:30:03 -07:00
2014-11-21 11:05:28 -05:00
2015-07-01 16:13:56 -07:00
2015-10-27 12:06:06 -07:00
2015-12-11 01:54:48 +09:00
2015-03-19 17:32:43 -07:00
2015-03-19 17:32:43 -07:00
2015-11-12 06:52:43 -08:00
2015-12-09 18:22:45 -08:00
2015-03-17 14:08:00 -07:00
2015-11-20 15:31:47 -08:00
2015-12-11 00:21:58 -08:00
2015-12-11 00:21:58 -08:00
2015-07-17 18:59:11 +02:00
2015-12-07 12:03:38 +01:00
2015-12-07 12:03:38 +01:00
2015-07-01 16:13:56 -07:00
2015-01-13 00:04:08 -08:00
2015-07-01 16:13:56 -07:00
2015-07-01 16:13:56 -07:00
2015-04-13 15:58:45 -07:00
2015-06-17 11:21:18 -07:00
2015-06-17 11:21:18 -07:00
2015-10-16 14:10:33 -07:00
2015-10-01 08:29:31 +13:00
2015-07-02 17:23:41 -07:00
2015-11-18 16:23:19 -08:00
2015-03-12 12:07:10 -07:00