Fix incorrect time magnitude on delayed call (#10195)

Fixes https://github.com/matrix-org/synapse/issues/10030.

We were expecting milliseconds where we should have provided a value in seconds.

The impact of this bug isn't too bad. The code is intended to count the number of remote servers that the homeserver can see and report that as a metric. This metric is supposed to run initially 1 second after server startup, and every 60s as well. Instead, it ran 1,000 seconds after server startup, and every 60s after startup.

This fix allows for the correct metrics to be collected immediately, as well as preventing a random collection 1,000s in the future after startup.
This commit is contained in:
Andrew Morgan 2021-06-17 15:04:26 +01:00 committed by GitHub
parent a911dd768b
commit 6f1a28de19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/10195.bugfix Normal file
View file

@ -0,0 +1 @@
Fix a bug introduced in Synpase 1.7.2 where remote server count metrics collection would be incorrectly delayed on startup. Found by @heftig.

View file

@ -90,7 +90,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
60 * 1000, 60 * 1000,
) )
self.hs.get_clock().call_later( self.hs.get_clock().call_later(
1000, 1,
self._count_known_servers, self._count_known_servers,
) )
LaterGauge( LaterGauge(