[MM-60307] Fix racy use of session in NewWebConn (#28195)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d6c11d1d26
Коммит
40d2ae97f1
@@ -17,6 +17,11 @@ import (
|
||||
func (ps *PlatformService) ReturnSessionToPool(session *model.Session) {
|
||||
if session != nil {
|
||||
session.Id = ""
|
||||
// Once the session is retrieved from the pool, all existing prop fields are cleared.
|
||||
// To avoid a race between clearing the props and accessing it, clear the props maps before returning it to the pool.
|
||||
clear(session.Props)
|
||||
// Also clear the team members slice to avoid a similar race condition.
|
||||
clear(session.TeamMembers)
|
||||
ps.sessionPool.Put(session)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user