MM-57152: Get webconn count from the whole cluster (#26813)
We were setting the user status to offline without checking for connections on other nodes in a cluster. Now we implement a request-response mechanism for the whole cluster and we check that before setting a user to offline. https://mattermost.atlassian.net/browse/MM-57153 ```release-note Fix a bug where the user status would incorrectly be set to offline without checking for connections in other nodes in an HA cluster. ``` Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5c11de1373
Коммит
0cee332001
@@ -372,17 +372,6 @@ func (wc *WebConn) isSet(val string) bool {
|
||||
return val != UnsetPresenceIndicator
|
||||
}
|
||||
|
||||
// areAllInactive returns whether all of the connections
|
||||
// are inactive or not.
|
||||
func areAllInactive(conns []*WebConn) bool {
|
||||
for _, conn := range conns {
|
||||
if conn.active.Load() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// GetSession returns the session of the connection.
|
||||
func (wc *WebConn) GetSession() *model.Session {
|
||||
return wc.session.Load()
|
||||
|
||||
Ссылка в новой задаче
Block a user