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

Batch up outgoing read-receipts to reduce federation traffic.#4890

Merged
richvdh merged 2 commits into
developfrom
rav/rr_batching
Mar 20, 2019
Merged

Batch up outgoing read-receipts to reduce federation traffic.#4890
richvdh merged 2 commits into
developfrom
rav/rr_batching

Conversation

@richvdh
Copy link
Copy Markdown
Member

@richvdh richvdh commented Mar 19, 2019

Rate-limit outgoing read-receipts as per #4730.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2019

Codecov Report

Merging #4890 into develop will increase coverage by 0.02%.
The diff coverage is 89.65%.

@@             Coverage Diff             @@
##           develop    #4890      +/-   ##
===========================================
+ Coverage    77.94%   77.96%   +0.02%     
===========================================
  Files          326      326              
  Lines        33958    34008      +50     
  Branches      5601     5609       +8     
===========================================
+ Hits         26467    26514      +47     
  Misses        5871     5871              
- Partials      1620     1623       +3

Comment thread synapse/handlers/receipts.py
@richvdh richvdh requested a review from a team March 19, 2019 12:57
Copy link
Copy Markdown
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, modulo nit

origin=self._server_name,
destination=self._destination,
edu_type="m.receipt",
content=self._pending_rrs,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit nervous about not limiting the number of receipts going in here tbh. Can we limit it to less than 100 at least?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, though given it's a 3-level dict, that's not completely trivial. What are your concerns?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that we end up sending 100s of read receipts in a single transaction, causing the remote to fall over. It feels a bit weird to bother limiting EDUs if we end up circumventing that for read receipts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the far end falls over because it has received too many RRs, we ought to spec a limit rather than trusting other servers not to DoS us.

I'd rather hope that we won't end up with that many RRs queued up. But ok, suppose we decide to limit the number of RRs in an EDU. Presumably you'd actually want me to limit the number in a transaction rather than just sending two edus with 100 RRs in each in a single transaction?

It just feels like a bunch of work that I'm not convinced is justified. It's certainly not a nit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IRL conversation: it's not entirely clear what would be the right thing to do here. Let's just get it shipped

@richvdh richvdh merged commit a902d13 into develop Mar 20, 2019
@richvdh richvdh deleted the rav/rr_batching branch March 20, 2019 16:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants