Refactor ResponseCache usage
Adds a `.wrap` method to ResponseCache which wraps up the boilerplate of a (get, set) pair, and then use it throughout the codebase. This will be largely non-functional, but does include the following functional changes: * federation_server.on_context_state_request: drops use of _server_linearizer which looked redundant and could cause incorrect cache misses by yielding between the get and the set. * RoomListHandler.get_remote_public_room_list(): fixes logcontext leaks * the wrap function includes some logging. I'm hoping this won't be too noisy on production.
Showing
- synapse/appservice/api.py 1 addition, 7 deletionssynapse/appservice/api.py
- synapse/federation/federation_server.py 5 additions, 11 deletionssynapse/federation/federation_server.py
- synapse/handlers/room_list.py 13 additions, 25 deletionssynapse/handlers/room_list.py
- synapse/handlers/sync.py 6 additions, 10 deletionssynapse/handlers/sync.py
- synapse/replication/http/send_event.py 6 additions, 12 deletionssynapse/replication/http/send_event.py
- synapse/util/caches/response_cache.py 56 additions, 2 deletionssynapse/util/caches/response_cache.py
Loading
Please register or sign in to comment