Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix bridge: On M_LIMIT_EXCEEDED, matterbridge drops messages instead of backoff+retry #1238

Closed
BenWiederhake opened this issue Sep 9, 2020 · 2 comments

Comments

@BenWiederhake
Copy link
Contributor

Describe the bug

When there is a lot of traffic, matterbridge may end up making a lot of requests to the matrix homeserver, which may respond with M_LIMIT_EXCEEDED. Some of these messages are lost, without good indication in the chat itself – in particular, immediately following messages make it through just fine.

To Reproduce

  • Set up and start a bridge between Telegram and matrix
  • Upload a bunch of JavaScript files to Telegram (Why specifically JS? Because there's a different bug. Now you know how I ran into it.)
  • Observe that only some of them make it to Matrix.

Expected behavior

All of the files should eventually "arrive" in Matrix. For example, matterbridge could back off and try again "after a few moments".

Screenshots/debug logs

Not really appliccable. Here's a log line anyway.

time="2020-09-09T23:50:52+02:00" level=error msg="file comment failed: gomatrix.HTTPError{Contents:[]uint8{0x7b, 0x22, 0x65, … some hex …, 0x7d}, WrappedError:gomatrix.RespError{ErrCode:"M_LIMIT_EXCEEDED", Err:"Too Many Requests"}, Message:"Failed to PUT JSON to /_matrix/client/r0/rooms/!SeCrEtRoOm:matrix.org/send/m.room.message/go1234567890123456789", Code:429}" func=handleUploadFile file="bridge/matrix/matrix.go:345" prefix=matrix

Environment (please complete the following information):

  • OS: Linux
  • Matterbridge version: 1.18.3
@BenWiederhake
Copy link
Contributor Author

Note that this is different from #1201, as here we encounter a ratelimit on sending, which will require a more involved message queue.

@42wim 42wim added the matrix label Nov 22, 2020
42wim added a commit that referenced this issue Dec 5, 2020
@42wim
Copy link
Owner

42wim commented Dec 5, 2020

@BenWiederhake care to test PR #1326 ?

@42wim 42wim closed this as completed in 2d3c26a Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants