Fix caching of remote servers' signature keys
The `@cached` decorator on `KeyStore._get_server_verify_key` was missing its `num_args` parameter, which meant that it was returning the wrong key for any server which had more than one recorded key. By way of a fix, change the default for `num_args` to be *all* arguments. To implement that, factor out a common base class for `CacheDescriptor` and `CacheListDescriptor`.
Showing
- synapse/util/caches/descriptors.py 72 additions, 63 deletionssynapse/util/caches/descriptors.py
- tests/storage/test_keys.py 53 additions, 0 deletionstests/storage/test_keys.py
- tests/util/caches/__init__.py 14 additions, 0 deletionstests/util/caches/__init__.py
- tests/util/caches/test_descriptors.py 86 additions, 0 deletionstests/util/caches/test_descriptors.py
Loading
Please register or sign in to comment