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

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

Merged
merged 2 commits into from
Mar 20, 2019

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Mar 19, 2019

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

@codecov
Copy link

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

@richvdh richvdh requested a review from a team March 19, 2019 12:57
Copy link
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
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
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
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
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
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