MM-27116: Drain push notification channel before closing (#15066)

* MM-27116: Drain push notification channel before closing

Without this, pending push notifications will not be sent when shutting down
or restarting the server.

* Fix race

* Re-arrange server shutdown

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2020-07-24 20:23:46 +05:30
коммит произвёл GitHub
родитель d05fd5327b
Коммит c0fa478cdd
2 изменённых файлов: 57 добавлений и 37 удалений

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

@@ -641,7 +641,6 @@ func (s *Server) Shutdown() error {
defer sentry.Flush(2 * time.Second)
s.HubStop()
s.StopPushNotificationsHubWorkers()
s.ShutDownPlugins()
s.RemoveLicenseListener(s.licenseListenerId)
s.RemoveClusterLeaderChangedListener(s.clusterLeaderListenerId)
@@ -659,6 +658,8 @@ func (s *Server) Shutdown() error {
s.StopHTTPServer()
s.stopLocalModeServer()
// Push notification hub needs to be shutdown after HTTP server
s.StopPushNotificationsHubWorkers()
s.WaitForGoroutines()