forked-synapse/synapse/util
Jonathan de Jong f5c93fc993
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.<remove>()`, 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 <jonathan@automatia.nl>
2021-02-24 13:57:00 +00:00
..
caches Fix #8518 (sync requests being cached wrongly on timeout) (#9358) 2021-02-24 13:57:00 +00:00
__init__.py Remove frozendict_json_encoder and support frozendicts everywhere 2020-10-28 15:56:57 +00:00
async_helpers.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
daemonize.py Stop the parent process flushing the logs on exit (#8012) 2020-08-05 09:35:17 +01:00
distributor.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
file_consumer.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
frozenutils.py Remove frozendict_json_encoder and support frozendicts everywhere 2020-10-28 15:56:57 +00:00
hash.py Use the v2 Identity Service API for lookups (MSC2134 + MSC2140) (#5976) 2019-09-11 16:02:42 +01:00
httpresourcetree.py Replace instance variations of homeserver with correct case/spacing 2019-11-12 13:08:12 +00:00
iterutils.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
jsonobject.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
logcontext.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
logformatter.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
manhole.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
metrics.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
module_loader.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
msisdn.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
patch_inline_callbacks.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
ratelimitutils.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
retryutils.py Tell Black to format code for Python 3.5 (#8664) 2020-10-27 23:26:36 +00:00
rlimit.py Remove usage of deprecated logger.warn method from codebase (#6271) 2019-10-31 10:23:24 +00:00
stringutils.py Type hints and validation improvements. (#9321) 2021-02-08 13:59:54 -05:00
templates.py Backout changes for automatically calculating the public baseurl. (#9313) 2021-02-11 11:16:54 -05:00
threepids.py Fix inconsistent handling of upper and lower cases of email addresses. (#7021) 2020-07-03 14:03:13 +01:00
versionstring.py Handle FileNotFound error in checking git repository version (#6284) 2019-10-30 11:00:15 +00:00
wheel_timer.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00