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

Problems with BatchingQueue #10068

@richvdh

Description

@richvdh

#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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions