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

Commit

Permalink
Merge pull request #5418 from matrix-org/erikj/fix_send_fed_with_limi…
Browse files Browse the repository at this point in the history
…t_zero

Fix bug sending federation transactions with lots of EDUs
  • Loading branch information
erikjohnston authored Jun 10, 2019
2 parents 0167447 + 48748c0 commit 78e74ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/5418.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where attempting to send transactions with large number of EDUs can fail.
4 changes: 4 additions & 0 deletions synapse/storage/deviceinbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def get_new_device_msgs_for_remote(
if not has_changed or last_stream_id == current_stream_id:
return defer.succeed(([], current_stream_id))

if limit <= 0:
# This can happen if we run out of room for EDUs in the transaction.
return defer.succeed(([], last_stream_id))

def get_new_messages_for_remote_destination_txn(txn):
sql = (
"SELECT stream_id, messages_json FROM device_federation_outbox"
Expand Down

0 comments on commit 78e74ab

Please sign in to comment.