MM-8607: Add ability to turn off non-critical services when under load; cluster support (#13267)

* MM-8607: Add cluster support for server busy status

MM-8607: Busy.Cluster should be non-exported

MM-8607: rename logging field seconds -> expires_sec

MM-8607: each node clears its own busy flag

MM-8607: ensure unit tests are not sensitive to test machine speed

* MM-8607: chg comment to force CI rebuild
Этот коммит содержится в:
Doug Lauder
2019-12-03 12:56:40 -05:00
коммит произвёл Jesús Espino
родитель 4ebc71ed38
Коммит 420c411595
8 изменённых файлов: 173 добавлений и 30 удалений

Просмотреть файл

@@ -218,3 +218,13 @@ func (a *App) TestEmail(userId string, cfg *model.Config) *model.AppError {
return nil
}
// ServerBusyStateChanged is called when a CLUSTER_EVENT_BUSY_STATE_CHANGED is received.
func (a *App) ServerBusyStateChanged(sbs *model.ServerBusyState) {
a.Srv.Busy.ClusterEventChanged(sbs)
if sbs.Busy {
mlog.Warn("server busy state activitated via cluster event - non-critical services disabled", mlog.Int64("expires_sec", sbs.Expires))
} else {
mlog.Info("server busy state cleared via cluster event - non-critical services enabled")
}
}