This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Harden ResponseCache (and fix #9507)#9522
Closed
ShadowJonathan wants to merge 5 commits intomatrix-org:developfrom
Closed
Harden ResponseCache (and fix #9507)#9522ShadowJonathan wants to merge 5 commits intomatrix-org:developfrom
ShadowJonathan wants to merge 5 commits intomatrix-org:developfrom
Conversation
Contributor
Author
|
(I also split the functions into class-level private methods, because it was getting too crowded with 3 local functions) |
4 tasks
richvdh
reviewed
Mar 2, 2021
Comment on lines
+109
to
+112
| should_cache = all( | ||
| self._safe_call(func, r, key=key) | ||
| for func in self.pending_conditionals.pop(key, []) | ||
| ) |
Member
There was a problem hiding this comment.
for links: I've argued in #synapse-dev and https://github.com/matrix-org/synapse/pull/9358/files#r585481702 that we should only support one conditional per key, which simplifies this code.
Contributor
Author
There was a problem hiding this comment.
I'll add that to the "small changes to ResponseCache PR", this one is focused on fixing #9507, i dont wanna drag everything else into here.
clokep
reviewed
Mar 2, 2021
This was referenced Mar 2, 2021
Contributor
Author
|
Folded into #9739 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #9507 by making
ResponseCacheadditionally not cache the result when;Previously, the latter could cause the cache not to be evicted inside the
errbackof theObservableDeferred, because these conditionals would be evaluated (and have an exception thrown) before acallLateror immidiate cache eviction could be done, this what caused #9507 (most likely).Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>Fixes #9507