Klaus Post
a2a48cc065
Optimize read locker cleanup (#14200)
When objects hold a lot of read locks cleanup time grows exponentially.
```
BEFORE:
Unable to complete tests.
AFTER:
=== RUN Test_localLocker_expireOldLocksExpire/100-locks/1-read
local-locker_test.go:298: Scan Took: 0s. Left: 100/100
local-locker_test.go:317: Expire 50% took: 0s. Left: 44/44
local-locker_test.go:331: Expire rest took: 0s. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/100-locks/100-read
local-locker_test.go:298: Scan Took: 0s. Left: 10000/100
local-locker_test.go:317: Expire 50% took: 1ms. Left: 5000/100
local-locker_test.go:331: Expire rest took: 1ms. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/100-locks/1000-read
local-locker_test.go:298: Scan Took: 2ms. Left: 100000/100
local-locker_test.go:317: Expire 50% took: 55ms. Left: 50038/100
local-locker_test.go:331: Expire rest took: 29ms. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/10000-locks/1-read
local-locker_test.go:298: Scan Took: 1ms. Left: 10000/10000
local-locker_test.go:317: Expire 50% took: 2ms. Left: 5019/5019
local-locker_test.go:331: Expire rest took: 2ms. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/10000-locks/100-read
local-locker_test.go:298: Scan Took: 23ms. Left: 1000000/10000
local-locker_test.go:317: Expire 50% took: 160ms. Left: 499798/10000
local-locker_test.go:331: Expire rest took: 138ms. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/10000-locks/1000-read
local-locker_test.go:298: Scan Took: 200ms. Left: 10000000/10000
local-locker_test.go:317: Expire 50% took: 5.888s. Left: 5000196/10000
local-locker_test.go:331: Expire rest took: 3.417s. Left: 0/0
=== RUN Test_localLocker_expireOldLocksExpire/1000000-locks/1-read
local-locker_test.go:298: Scan Took: 133ms. Left: 1000000/1000000
local-locker_test.go:317: Expire 50% took: 348ms. Left: 500255/500255
local-locker_test.go:331: Expire rest took: 307ms. Left: 0/0
```
2022-01-27 14:10:57 -08:00
..
2022-01-10 14:26:26 -08:00
2022-01-19 10:48:00 -08:00
2021-10-28 07:36:34 -07:00
2022-01-19 20:02:24 -08:00
2022-01-11 18:48:43 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-10 09:07:49 -08:00
2022-01-21 08:48:21 -08:00
2022-01-02 09:15:06 -08:00
2021-11-09 09:25:13 -08:00
2022-01-19 20:02:24 -08:00
2022-01-27 08:13:03 -08:00
2022-01-02 09:15:06 -08:00
2022-01-21 08:48:21 -08:00
2021-06-01 14:59:40 -07:00
2022-01-03 01:28:52 -08:00
2021-06-01 14:59:40 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-11-25 13:06:25 -08:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-12-22 11:40:21 -08:00
2021-11-29 14:38:57 -08:00
2021-12-17 00:46:30 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-07-15 22:32:06 -07:00
2022-01-24 11:28:45 -08:00
2021-05-24 09:28:19 -07:00
2021-05-17 08:32:28 -07:00
2021-08-27 09:16:36 -07:00
2021-06-01 14:59:40 -07:00
2022-01-12 18:49:01 -08:00
2022-01-20 13:03:15 -08:00
2021-05-14 00:59:05 -07:00
2021-10-06 16:36:31 -07:00
2021-09-21 09:02:15 -07:00
2022-01-03 01:28:52 -08:00
2022-01-26 21:53:36 -08:00
2021-07-21 19:12:44 -07:00
2022-01-02 09:15:06 -08:00
2021-12-14 09:41:44 -08:00
2022-01-26 14:33:10 -08:00
2021-11-16 09:28:29 -08:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2021-09-20 17:41:01 -07:00
2022-01-03 10:22:58 -08:00
2022-01-03 10:22:58 -08:00
2022-01-05 17:05:28 -08:00
2022-01-10 14:26:26 -08:00
2021-10-06 16:36:31 -07:00
2022-01-02 09:15:06 -08:00
2022-01-05 17:05:28 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-09-18 13:31:35 -07:00
2021-09-18 13:31:35 -07:00
2022-01-02 09:15:06 -08:00
2022-01-03 01:28:52 -08:00
2022-01-19 10:45:42 -08:00
2021-11-17 12:10:57 -08:00
2021-11-17 12:10:57 -08:00
2022-01-25 16:31:44 -08:00
2022-01-06 13:08:21 -08:00
2022-01-02 09:15:06 -08:00
2021-06-01 14:59:40 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-24 17:09:12 -08:00
2022-01-03 10:22:58 -08:00
2021-11-25 13:06:25 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-06-01 14:59:40 -07:00
2021-06-24 16:24:12 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-11-16 09:28:29 -08:00
2022-01-24 11:28:45 -08:00
2021-11-16 09:28:29 -08:00
2021-04-23 11:58:53 -07:00
2021-06-17 20:27:04 -07:00
2021-08-07 22:43:01 -07:00
2021-11-01 08:04:03 -07:00
2022-01-26 08:34:56 -08:00
2022-01-02 09:15:06 -08:00
2022-01-24 11:28:45 -08:00
2022-01-26 08:34:56 -08:00
2021-10-23 18:38:33 -07:00
2022-01-26 08:34:56 -08:00
2022-01-26 08:34:56 -08:00
2021-10-23 18:38:33 -07:00
2022-01-11 08:43:18 -08:00
2021-12-08 14:52:31 -08:00
2022-01-02 09:15:06 -08:00
2021-08-18 18:35:22 -07:00
2021-08-18 18:35:22 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-26 11:55:58 -08:00
2021-11-16 09:28:29 -08:00
2021-10-28 07:36:34 -07:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-04-30 08:50:39 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-10 09:07:49 -08:00
2022-01-20 13:03:15 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-10 09:07:49 -08:00
2021-11-16 09:28:29 -08:00
2022-01-12 18:49:01 -08:00
2021-05-17 08:32:28 -07:00
2022-01-12 18:49:01 -08:00
2021-04-23 11:58:53 -07:00
2021-12-03 09:26:30 -08:00
2022-01-07 19:11:54 -08:00
2021-12-23 23:01:46 -08:00
2022-01-02 09:15:06 -08:00
2022-01-13 11:07:41 -08:00
2021-11-21 10:41:30 -08:00
2022-01-02 09:15:06 -08:00
2021-11-21 10:41:30 -08:00
2021-12-22 11:43:01 -08:00
2022-01-14 10:01:25 -08:00
2022-01-03 01:28:52 -08:00
2022-01-14 10:01:25 -08:00
2022-01-11 18:48:43 -08:00
2022-01-11 18:48:43 -08:00
2022-01-14 10:32:35 -08:00
2022-01-14 10:32:35 -08:00
2022-01-24 11:28:45 -08:00
2022-01-10 09:07:49 -08:00
2022-01-24 19:40:02 -08:00
2021-11-02 08:11:50 -07:00
2022-01-26 08:34:56 -08:00
2021-10-18 08:43:04 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-24 11:28:45 -08:00
2022-01-24 11:28:45 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2021-10-08 12:40:34 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-26 08:34:56 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-06-14 12:53:49 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2021-06-20 23:04:47 -07:00
2021-09-18 13:31:35 -07:00
2021-04-30 08:50:39 -07:00
2021-11-01 08:04:03 -07:00
2021-11-08 09:28:13 -08:00
2022-01-10 21:22:17 -08:00
2022-01-24 17:09:12 -08:00
2022-01-17 08:34:14 -08:00
2021-06-01 14:59:40 -07:00
2022-01-13 17:25:08 -08:00
2021-04-23 11:58:53 -07:00
2021-11-01 08:04:03 -07:00
2022-01-02 09:15:06 -08:00
2021-07-12 10:16:10 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-10-07 19:03:46 -07:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2021-12-11 09:03:39 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-22 16:36:11 -08:00
2022-01-22 16:36:11 -08:00
2022-01-26 21:53:36 -08:00
2022-01-26 21:53:36 -08:00
2022-01-25 16:31:44 -08:00
2022-01-25 16:31:44 -08:00
2022-01-25 16:31:44 -08:00
2021-04-23 11:58:53 -07:00
2021-08-07 22:43:01 -07:00
2022-01-27 14:10:57 -08:00
2022-01-27 14:10:57 -08:00
2021-06-01 14:59:40 -07:00
2021-11-23 09:51:53 -08:00
2021-10-15 03:12:13 -07:00
2021-06-01 14:59:40 -07:00
2021-09-30 11:53:01 -07:00
2021-10-15 03:12:13 -07:00
2021-05-28 15:17:01 -07:00
2021-04-23 11:58:53 -07:00
2021-11-08 10:26:08 -08:00
2021-09-08 11:06:45 -07:00
2021-07-05 15:34:41 -07:00
2021-09-08 11:06:45 -07:00
2022-01-02 09:15:06 -08:00
2021-12-08 17:34:52 -08:00
2021-09-08 11:06:45 -07:00
2021-07-05 15:34:41 -07:00
2021-12-15 09:19:11 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-12-09 08:38:46 -08:00
2021-11-08 10:26:08 -08:00
2021-06-30 16:08:20 -07:00
2022-01-25 16:31:44 -08:00
2022-01-26 21:53:36 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-20 13:03:15 -08:00
2022-01-02 09:15:06 -08:00
2022-01-26 14:33:10 -08:00
2021-11-16 09:28:29 -08:00
2022-01-20 10:55:18 -08:00
2022-01-11 18:48:43 -08:00
2022-01-02 09:15:06 -08:00
2022-01-06 10:47:49 -08:00
2021-04-23 11:58:53 -07:00
2021-06-01 14:59:40 -07:00
2022-01-10 09:07:49 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-27 08:13:03 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-03 01:28:52 -08:00
2021-08-18 18:35:22 -07:00
2021-08-18 18:35:22 -07:00
2021-08-18 18:35:22 -07:00
2021-08-18 18:35:22 -07:00
2021-06-01 14:59:40 -07:00
2021-08-30 08:40:16 -07:00
2022-01-02 09:15:06 -08:00
2021-09-29 16:40:28 -07:00
2021-08-18 18:35:22 -07:00
2021-07-09 16:20:51 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2022-01-26 14:33:10 -08:00
2022-01-26 14:33:10 -08:00
2022-01-27 08:13:03 -08:00
2022-01-10 14:26:26 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-11-16 09:28:29 -08:00
2022-01-24 11:28:45 -08:00
2021-11-01 08:04:03 -07:00
2022-01-02 09:15:06 -08:00
2022-01-03 01:28:52 -08:00
2021-04-23 11:58:53 -07:00
2022-01-20 13:03:15 -08:00
2021-09-08 13:31:51 -07:00
2021-08-05 15:01:19 -07:00
2021-11-25 13:06:25 -08:00
2021-11-23 16:09:28 -08:00
2021-04-23 11:58:53 -07:00
2021-11-18 17:19:58 -08:00
2022-01-02 09:15:06 -08:00
2021-11-22 16:07:23 -08:00
2021-11-25 13:06:25 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-12-22 11:40:21 -08:00
2021-11-25 13:06:25 -08:00
2022-01-02 09:15:06 -08:00
2022-01-26 15:05:59 -08:00
2022-01-10 09:07:49 -08:00
2022-01-25 16:31:44 -08:00
2021-04-23 11:58:53 -07:00
2022-01-25 16:31:44 -08:00
2021-10-04 09:01:52 -07:00
2022-01-02 09:15:06 -08:00
2021-12-09 17:52:53 -08:00
2022-01-06 10:47:49 -08:00
2021-12-21 10:08:26 -08:00
2022-01-02 09:15:06 -08:00
2021-12-02 11:29:16 -08:00
2021-04-23 11:58:53 -07:00
2021-11-25 13:06:25 -08:00
2021-09-07 19:03:48 -07:00
2021-09-07 19:03:48 -07:00
2022-01-07 17:41:43 -08:00
2022-01-22 16:36:11 -08:00
2021-09-07 19:03:48 -07:00
2022-01-14 10:32:35 -08:00
2021-04-23 11:58:53 -07:00
2021-05-06 08:52:02 -07:00
2022-01-26 14:33:10 -08:00
2021-06-03 14:26:51 -07:00
2021-06-03 14:26:51 -07:00
2021-06-03 14:26:51 -07:00
2022-01-02 09:15:06 -08:00
2022-01-26 14:33:10 -08:00
2021-06-30 19:32:07 -07:00
2021-08-17 07:50:00 -07:00
2022-01-02 09:15:06 -08:00
2022-01-24 11:28:45 -08:00
2021-04-23 11:58:53 -07:00
2022-01-10 14:26:26 -08:00
2021-12-06 09:45:23 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-06-01 14:59:40 -07:00
2021-06-01 14:59:40 -07:00
2022-01-06 11:34:02 -08:00
2021-11-16 09:28:29 -08:00
2022-01-02 09:15:06 -08:00
2022-01-26 08:34:56 -08:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-07-05 18:44:04 -07:00
2021-11-10 22:33:17 -08:00
2021-08-18 18:35:22 -07:00
2021-08-18 18:35:22 -07:00
2022-01-24 11:28:45 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-25 16:31:44 -08:00
2021-04-23 11:58:53 -07:00
2021-04-23 11:58:53 -07:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2022-01-02 09:15:06 -08:00
2021-04-23 11:58:53 -07:00
2021-10-21 11:20:13 -07:00
2022-01-02 09:15:06 -08:00
2021-11-18 12:15:22 -08:00
2021-11-18 12:15:22 -08:00
2021-12-02 11:29:16 -08:00
2022-01-19 10:48:00 -08:00
2022-01-19 10:48:00 -08:00
2022-01-19 10:48:00 -08:00
2022-01-02 09:15:06 -08:00
2021-11-18 12:15:22 -08:00
2021-11-18 12:15:22 -08:00
2022-01-26 08:34:56 -08:00