-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix losing incoming EDUs if debug logging enabled #11890
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a bug introduced in Synapse 1.51.0rc1 where incoming federation transactions containing at least one EDU would be dropped if debug logging was enabled for `synapse.8631_debug`. |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -109,11 +109,11 @@ async def on_PUT( | |||||||||||||||||||||||
) | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
if issue_8631_logger.isEnabledFor(logging.DEBUG): | ||||||||||||||||||||||||
DEVICE_UPDATE_EDUS = {"m.device_list_update", "m.signing_key_update"} | ||||||||||||||||||||||||
DEVICE_UPDATE_EDUS = ["m.device_list_update", "m.signing_key_update"] | ||||||||||||||||||||||||
device_list_updates = [ | ||||||||||||||||||||||||
edu.content | ||||||||||||||||||||||||
for edu in transaction_data.get("edus", []) | ||||||||||||||||||||||||
if edu.edu_type in DEVICE_UPDATE_EDUS | ||||||||||||||||||||||||
if edu.get("edu_type") in DEVICE_UPDATE_EDUS | ||||||||||||||||||||||||
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 could still error if the 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. Oh I see, I'm implicitly assuming that the edu_type is hashable. 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. Yep! It is probably OK, but if the downside is breaking federation...that's pretty bad. 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. That's done. I haven't fixed up the TX side here synapse/synapse/federation/sender/transaction_manager.py Lines 128 to 138 in f160fe1
because there we really do have an |
||||||||||||||||||||||||
] | ||||||||||||||||||||||||
if device_list_updates: | ||||||||||||||||||||||||
issue_8631_logger.debug( | ||||||||||||||||||||||||
|
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.
edu.content
does not exist.