Agniva De Sarker
06ad69a406
MM-47465: Fix flaky TestDeleteChannel ( #21686 )
...
Creating the post in a separate goroutine would create a race condition
because that method also calls GetChannel. This can cause a bug
if the cache was wiped before the the other goroutine would get
a chance to update the cache. And if that happens, then
it would populate the cache with the old value.
Pseudo-code
```
func deleteChannel() {
go func() {
getFromCache()
}()
updateDB()
wipeCache() // a
}
func getFromCache() {
err := checkCache()
if err == ErrNotFound {
getFromDB() // x
updateCache() // y
}
}
func Test() {
deleteChannel()
getFromCache()
}
```
If the sequence of events happen like
- x
- a
- y
Then the getFromCache() call later will get the wrong
value from cache.
The fix is to make the call synchronous.
https://mattermost.atlassian.net/browse/MM-47465
Special thanks to @noxer for finding the root cause.
```release-note
NONE
```
2022-11-17 20:44:18 +05:30
..
2022-10-25 16:17:35 +02:00
2022-07-05 09:46:50 +03:00
2022-08-09 14:25:46 +03:00
2022-08-31 13:29:37 +02:00
2022-10-06 11:04:21 +03:00
2022-11-17 14:53:54 +05:30
2022-11-02 22:40:26 +02:00
2022-11-03 06:31:38 +01:00
2022-07-14 11:01:29 +02:00
2022-10-26 09:08:24 -04:00
2022-09-02 13:17:22 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-08-25 19:59:16 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-17 14:53:54 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-06-09 14:56:26 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-07-28 10:04:21 +05:30
2022-10-06 11:04:21 +03:00
2022-07-28 10:04:21 +05:30
2022-10-06 11:04:21 +03:00
2022-08-18 11:01:37 +02:00
2022-08-23 11:42:04 +03:00
2021-09-01 14:43:12 +02:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-09 12:16:20 +04:00
2022-11-17 20:44:18 +05:30
2022-11-15 00:57:04 +04:00
2022-09-08 11:01:50 -04:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-15 00:57:04 +04:00
2022-08-02 20:48:54 +05:30
2022-08-10 10:56:58 +02:00
2021-07-21 16:38:39 +02:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2021-01-04 11:32:29 +05:30
2022-07-14 11:01:29 +02:00
2021-07-22 12:21:47 +05:30
2021-08-16 19:46:44 +02:00
2022-08-09 14:25:46 +03:00
2022-04-08 12:20:44 -05:00
2022-11-03 08:54:59 +01:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-02-14 18:21:18 +01:00
2022-10-06 11:04:21 +03:00
2022-11-04 17:13:14 +01:00
2022-11-04 17:13:14 +01:00
2022-11-04 17:13:14 +01:00
2022-08-09 14:25:46 +03:00
2022-01-20 10:07:27 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-09-28 12:52:53 -04:00
2022-10-11 19:04:09 +05:30
2022-11-02 22:40:26 +02:00
2022-11-17 14:53:54 +05:30
2022-11-17 14:53:54 +05:30
2022-10-06 11:04:21 +03:00
2021-08-12 17:43:10 +02:00
2022-10-06 11:04:21 +03:00
2022-11-01 09:37:58 +01:00
2022-10-06 11:04:21 +03:00
2021-03-24 10:32:16 +01:00
2021-03-24 10:32:16 +01:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-05-25 12:36:08 -04:00
2022-11-02 22:40:26 +02:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-08-18 11:01:37 +02:00
2022-03-31 18:25:46 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-02 22:40:26 +02:00
2021-08-17 16:08:04 -04:00
2022-10-06 11:04:21 +03:00
2022-10-20 11:05:22 +05:30
2022-10-20 11:05:22 +05:30
2022-10-21 12:24:36 +03:00
2022-10-06 11:04:21 +03:00
2022-11-09 12:16:20 +04:00
2022-11-09 12:16:20 +04:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-14 10:27:47 +05:30
2022-10-06 11:04:21 +03:00
2021-08-12 11:49:16 +02:00
2021-10-15 19:57:05 +05:30
2022-10-21 12:24:36 +03:00
2021-07-22 12:21:47 +05:30
2022-10-19 15:23:20 -04:00
2022-10-06 11:04:21 +03:00
2022-10-21 18:10:45 +02:00
2022-11-03 22:43:30 +04:00
2022-11-03 22:43:30 +04:00
2022-07-05 09:46:50 +03:00
2022-08-02 20:48:54 +05:30
2021-05-11 13:00:44 +03:00
2022-10-06 11:04:21 +03:00
2022-07-05 09:46:50 +03:00
2022-10-06 11:04:21 +03:00
2021-07-22 12:21:47 +05:30
2022-10-06 11:04:21 +03:00
2021-11-12 10:35:14 +05:30
2022-08-18 11:01:37 +02:00
2022-10-06 11:04:21 +03:00
2019-12-05 23:41:52 +04:00
2021-11-12 10:35:14 +05:30
2022-10-06 11:04:21 +03:00
2021-11-08 11:57:22 +05:30
2022-10-06 11:04:21 +03:00
2022-08-18 11:01:37 +02:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-11-15 00:57:04 +04:00
2022-10-06 11:04:21 +03:00
2022-08-18 11:01:37 +02:00
2022-11-03 08:54:59 +01:00
2022-11-03 08:54:59 +01:00
2022-11-09 12:16:20 +04:00
2022-11-16 13:42:26 +04:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-07-05 09:46:50 +03:00
2022-07-05 09:46:50 +03:00
2021-07-22 12:21:47 +05:30
2021-08-19 10:33:29 +02:00
2022-10-20 14:37:24 -04:00
2022-10-06 11:04:21 +03:00
2021-07-22 12:21:47 +05:30
2022-02-28 15:01:00 +05:30
2022-10-06 11:04:21 +03:00
2022-08-09 14:25:46 +03:00
2022-08-09 14:25:46 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-21 12:24:36 +03:00
2022-11-02 22:40:26 +02:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-07-14 11:01:29 +02:00
2022-10-06 11:04:21 +03:00
2021-07-22 12:21:47 +05:30
2022-10-11 19:04:09 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-08-09 14:25:46 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-24 16:20:56 -05:00
2022-10-24 16:20:56 -05:00
2021-11-12 10:16:19 +03:00
2022-10-06 11:04:21 +03:00
2022-08-09 14:25:46 +03:00
2022-10-11 19:04:09 +05:30
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2020-03-19 11:18:17 +01:00
2020-03-19 11:18:17 +01:00
2020-06-19 17:49:30 +05:30
2022-10-06 11:04:21 +03:00
2022-10-13 14:23:22 -07:00
2022-07-28 10:04:21 +05:30
2022-11-09 12:16:20 +04:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-10-06 11:04:21 +03:00
2022-07-14 11:01:29 +02:00
2022-10-06 11:04:21 +03:00
2022-09-02 13:17:22 +03:00
2022-10-06 11:04:21 +03:00