0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-15 03:23:54 +01:00

Fix bug sending federation transactions with lots of EDUs

If we try and send a transaction with lots of EDUs and we run out of
space, we call get_new_device_msgs_for_remote with a limit of 0, which
then failed.
This commit is contained in:
Erik Johnston 2019-06-10 16:21:42 +01:00
parent 8da0d83a54
commit c413540fb9

View file

@ -138,6 +138,10 @@ class DeviceInboxWorkerStore(SQLBaseStore):
if not has_changed or last_stream_id == current_stream_id: if not has_changed or last_stream_id == current_stream_id:
return defer.succeed(([], 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): def get_new_messages_for_remote_destination_txn(txn):
sql = ( sql = (
"SELECT stream_id, messages_json FROM device_federation_outbox" "SELECT stream_id, messages_json FROM device_federation_outbox"