From f5c93fc9931e4029bbd8000f398b6f39d67a8c46 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Wed, 24 Feb 2021 14:57:00 +0100 Subject: Fix #8518 (sync requests being cached wrongly on timeout) (#9358) This fixes #8518 by adding a conditional check on `SyncResult` in a function when `prev_stream_token == current_stream_token`, as a sanity check. In `CachedResponse.set.()`, the result is immediately popped from the cache if the conditional function returns "false". This prevents the caching of a timed-out `SyncResult` (that has `next_key` as the stream key that produced that `SyncResult`). The cache is prevented from returning a `SyncResult` that makes the client request the same stream key over and over again, effectively making it stuck in a loop of requesting and getting a response immediately for as long as the cache keeps those values. Signed-off-by: Jonathan de Jong --- changelog.d/9358.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/9358.misc (limited to 'changelog.d') diff --git a/changelog.d/9358.misc b/changelog.d/9358.misc new file mode 100644 index 0000000000..cc7614afc0 --- /dev/null +++ b/changelog.d/9358.misc @@ -0,0 +1 @@ +Added a fix that invalidates cache for empty timed-out sync responses. \ No newline at end of file -- cgit 1.4.1