Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix to ensure cache descriptors always return deferreds #6263

Merged
merged 3 commits into from Oct 29, 2019

Conversation

@erikjohnston
Copy link
Member

erikjohnston commented Oct 28, 2019

This is just a quick fix that wraps non-deferred results in deferreds when we return from the descriptors. We should/could also rip out the code that causes the underlying caches to swap out the ObservableDeferreds for unwrapped results, but that is more fiddly and invasive (and I don't know how this effects memory usage of caches).

I don't know how this effects CPU performance.

@erikjohnston erikjohnston marked this pull request as ready for review Oct 29, 2019
@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Oct 29, 2019
Copy link
Member

richvdh left a comment

lgtm, although the docstring on CacheListDescriptor says that the wrapped function can return an immediate result, which is now untrue.

@erikjohnston erikjohnston merged commit 561133c into develop Oct 29, 2019
6 of 8 checks passed
6 of 8 checks passed
buildkite/synapse Build #5172 failed (2 minutes, 32 seconds)
Details
buildkite/synapse/check-style Failed (exit status 1)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 24 seconds)
Details
buildkite/synapse/isort Passed (46 seconds)
Details
buildkite/synapse/mypy Passed (29 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (14 seconds)
Details
buildkite/synapse/packaging Passed (16 seconds)
Details
buildkite/synapse/pipeline Passed (3 seconds)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.