Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Module API: does not provide a way to invalidate caches in other workers #13513

Closed
MatMaul opened this issue Aug 12, 2022 · 3 comments · Fixed by #13667
Closed

Module API: does not provide a way to invalidate caches in other workers #13513

MatMaul opened this issue Aug 12, 2022 · 3 comments · Fixed by #13667
Assignees
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@MatMaul
Copy link
Contributor

MatMaul commented Aug 12, 2022

Currently if we use @cached() on a function on a module there is no cache invalidation happening between workers.

@babolivier babolivier added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Aug 12, 2022
@richvdh richvdh changed the title Module API: provides a way to invalidate caches in other workers Module API: does not provide a way to invalidate caches in other workers Aug 12, 2022
@clokep
Copy link
Member

clokep commented Aug 15, 2022

This sounds awfully low-level for a module to care about -- and very likely for things to be implemented improperly by modules. Would it be possible to provide a higher level feature to support what the module needs?

@MatMaul
Copy link
Contributor Author

MatMaul commented Aug 29, 2022

Currently modules that want to use @cached() already can and have to invalidate manually through cached_function.invalidate(). This however only invalidates locally, and the invalidation is not replicated through workers. The planned fix involves a new module API that allows to invalidate locally and replicate the invalidation to other workers.

Current WIP can be found here:
https://github.com/matrix-org/synapse/tree/mv/module-cache-invalidation

@reivilibre
Copy link
Contributor

+1 to noting that this is intended for modules to invalidate their own caches. I was quite scared from the title but the justification makes sense :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants