This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Improve logging and opentracing for to-device message handling #14598
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
76d44db
Stop adding a `message_id` to to-device messages
richvdh 3d88474
Rename Opentracing tag for to-device EDUs
richvdh 85954d9
Define some new opentracing tags
richvdh f7ababb
Improve opentracing in `/sendToDevice` handler
richvdh 64eb08a
Improve opentracing and logging for outgoing to-device messages
richvdh 7a2ff37
Improve opentracing and logging for received to-device message
richvdh 8fbdd8b
Improve opentracing and logging for serving to-device messages
richvdh d7ae20e
changelog
richvdh 8cdc1b1
Fix test
richvdh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1602,13 +1602,6 @@ async def _generate_sync_entry_for_to_device( | |
user_id, device_id, since_stream_id, now_token.to_device_key | ||
) | ||
|
||
for message in messages: | ||
# We pop here as we shouldn't be sending the message ID down | ||
# `/sync` | ||
message_id = message.pop("message_id", None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does mean that we'll send down There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's a detail I'm brushing under the carpet. |
||
if message_id: | ||
set_tag(SynapseTags.TO_DEVICE_MESSAGE_ID, message_id) | ||
|
||
logger.debug( | ||
"Returning %d to-device messages between %d and %d (current token: %d)", | ||
len(messages), | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do seem to use this over federation?
synapse/synapse/handlers/devicemessage.py
Line 108 in de6bb61
Or am I misreading the code? (It looks like there are more places we use
message_id
in general?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but this code is for handling local user -> local user DMs (see the condition at line 244).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaaaaaaaaaaaaaaaaah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For messages being sent over federation, messages are grouped into EDUs by destination server. We now generate a new message id for each EDU at line 268:
synapse/synapse/handlers/devicemessage.py
Line 268 in 76d44db