This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Description
#10017 introduced a BatchingQueue implementation. While reviewing #10035 I noticed a few oddities that could do with cleaning up:
- The params to
__init__ could do with docstrings, especially name - what is it used for?
- The prometheus metrics (
synapse_util_batching_queue_number_queued etc) don't appear to include the name label in their result.
- If the key is already being processed when
_process_queue starts, then _process_queue immediately returns (https://github.com/matrix-org/synapse/blob/v1.35.0rc1/synapse/util/batching_queue.py#L118-L119). However, it will pass through the finally block which will remove the key from self._processing_keys. This looks incorrect to me.
PreserveLoggingContext isn't free. consider moving it outside the loops?
- It would be nice to document the behaviour on exceptions.