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

Commit 3b8574b

Browse files
author
David Robertson
authored
Tag /send_join responses to detect faster joins (#14950)
* Tag /send_join responses to detect faster joins * Changelog * Define a proper SynapseTag * isort
1 parent 805b641 commit 3b8574b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

changelog.d/14950.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Faster joins: tag `v2/send_join/` requests to indicate if they served a partial join response.

synapse/federation/federation_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
run_in_background,
6363
)
6464
from synapse.logging.opentracing import (
65+
SynapseTags,
6566
log_kv,
67+
set_tag,
6668
start_active_span_from_edu,
6769
tag_args,
6870
trace,
@@ -678,6 +680,10 @@ async def on_send_join_request(
678680
room_id: str,
679681
caller_supports_partial_state: bool = False,
680682
) -> Dict[str, Any]:
683+
set_tag(
684+
SynapseTags.SEND_JOIN_RESPONSE_IS_PARTIAL_STATE,
685+
caller_supports_partial_state,
686+
)
681687
await self._room_member_handler._join_rate_per_room_limiter.ratelimit( # type: ignore[has-type]
682688
requester=None,
683689
key=room_id,

synapse/logging/opentracing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ class SynapseTags:
322322
# The name of the external cache
323323
CACHE_NAME = "cache.name"
324324

325+
# Boolean. Present on /v2/send_join requests, omitted from all others.
326+
# True iff partial state was requested and we provided (or intended to provide)
327+
# partial state in the response.
328+
SEND_JOIN_RESPONSE_IS_PARTIAL_STATE = "send_join.partial_state_response"
329+
325330
# Used to tag function arguments
326331
#
327332
# Tag a named arg. The name of the argument should be appended to this prefix.

0 commit comments

Comments
 (0)