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

Query flooding if reverse proxy is down #479

Open
@Ultimator14

Description

@Ultimator14

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions