Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Query flooding if reverse proxy is down #479

Open
Ultimator14 opened this issue Mar 14, 2022 · 1 comment
Open

Query flooding if reverse proxy is down #479

Ultimator14 opened this issue Mar 14, 2022 · 1 comment

Comments

@Ultimator14
Copy link

Ultimator14 commented Mar 14, 2022

I'm using a docker image of synapse (matrix.mydomain) and dimension (dimension.mydomain) behind a reverse proxy which handles encryption. From time to time, the reverse proxy crashes. Dimension is therefore unable to access matrix.mydomain.

Then dimension:

  1. Queries the DNS for matrix.mydomain
  2. Tries to connect to matrix.mydomain
  3. Gets ECONNREFUSED
  4. Immediately starts from 1 again

Last time the proxy was down for 5min. Meanwhile dimension sent 70.000 DNS queries which is more than 200 queries per second.
The CPU usage also goes up to 100%. This looks like an infinite loop to me.
It would be good to add a delay before retrying the failed connection.

The logs show this message for every connection attempt:

Mon, 14 Mar 2022 12:44:30 GMT [DEBUG] [MatrixClientLite] Performing sync with token <mytoken>
Mon, 14 Mar 2022 12:44:30 GMT [DEBUG] [MatrixHttpClient (REQ-<ascending number>)] GET https://matrix.pygos.space/_matrix/client/r0/sync
Mon, 14 Mar 2022 12:44:30 GMT [ERROR] [MatrixHttpClient (REQ-<ascending number>)] Error: connect ECONNREFUSED <myip>:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '<myip>',
  port: 443
}
Mon, 14 Mar 2022 12:44:30 GMT [ERROR] [MatrixClientLite] Error: connect ECONNREFUSED <myip>:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '<myip>',
  port: 443
}

@Ultimator14
Copy link
Author

Looks like this is an issue in matrix-bot-sdk which has been solved already in release v0.6.0-beta.1 by this Pull Request. However dimension still requires v0.5.19. I guess a version bump would be sufficient.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant