mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-21 21:13:09 -06:00
Remove assume offline on broadcast received
This commit is contained in:
parent
98c7711b84
commit
1df1a597ec
|
|
@ -762,8 +762,11 @@ func (r *FederationInternalAPI) PerformWakeupServers(
|
||||||
|
|
||||||
func (r *FederationInternalAPI) MarkServersAlive(destinations []gomatrixserverlib.ServerName) {
|
func (r *FederationInternalAPI) MarkServersAlive(destinations []gomatrixserverlib.ServerName) {
|
||||||
for _, srv := range destinations {
|
for _, srv := range destinations {
|
||||||
// Check the statistics cache for the blacklist status to prevent hitting
|
// Check the statistics cache for the blacklist & assumed offline status to prevent hitting
|
||||||
// the database unnecessarily.
|
// the database unnecessarily.
|
||||||
|
if r.statistics.ForServer(srv).AssumedOffline() {
|
||||||
|
_ = r.db.RemoveServerAssumedOffline(srv)
|
||||||
|
}
|
||||||
if r.queues.IsServerBlacklisted(srv) {
|
if r.queues.IsServerBlacklisted(srv) {
|
||||||
_ = r.db.RemoveServerFromBlacklist(srv)
|
_ = r.db.RemoveServerFromBlacklist(srv)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,7 @@ func (oqs *OutgoingQueues) RetryServer(srv gomatrixserverlib.ServerName) {
|
||||||
|
|
||||||
serverStatistics := oqs.statistics.ForServer(srv)
|
serverStatistics := oqs.statistics.ForServer(srv)
|
||||||
forceWakeup := serverStatistics.Blacklisted()
|
forceWakeup := serverStatistics.Blacklisted()
|
||||||
|
serverStatistics.RemoveAssumedOffline()
|
||||||
serverStatistics.RemoveBlacklist()
|
serverStatistics.RemoveBlacklist()
|
||||||
serverStatistics.ClearBackoff()
|
serverStatistics.ClearBackoff()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,11 @@ func (s *ServerStatistics) RemoveBlacklist() {
|
||||||
s.backoffCount.Store(0)
|
s.backoffCount.Store(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveAssumedOffline removes the assumed offline status from the server.
|
||||||
|
func (s *ServerStatistics) RemoveAssumedOffline() {
|
||||||
|
s.assumedOffline.Store(false)
|
||||||
|
}
|
||||||
|
|
||||||
// SuccessCount returns the number of successful requests. This is
|
// SuccessCount returns the number of successful requests. This is
|
||||||
// usually useful in constructing transaction IDs.
|
// usually useful in constructing transaction IDs.
|
||||||
func (s *ServerStatistics) SuccessCount() uint32 {
|
func (s *ServerStatistics) SuccessCount() uint32 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue