[MM-40682] - SIGSEGV after upgrade from 6.1.0 to 6.2.0 (#19192)
* [MM-40682] - SIGSEGV after upgrade from 6.1.0 to 6.2.0 * feedback impl
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
36008ae412
Коммит
0b1e9445c8
@@ -176,7 +176,9 @@ func (ch *Channels) initPlugins(c *request.Context, pluginDir, webappPluginDir s
|
||||
ch.pluginsLock.RUnlock()
|
||||
if pluginsEnvironment != nil || !*ch.srv.Config().PluginSettings.Enable {
|
||||
ch.syncPluginsActiveState()
|
||||
pluginsEnvironment.TogglePluginHealthCheckJob(*ch.srv.Config().PluginSettings.EnableHealthCheck)
|
||||
if pluginsEnvironment != nil {
|
||||
pluginsEnvironment.TogglePluginHealthCheckJob(*ch.srv.Config().PluginSettings.EnableHealthCheck)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/app/request"
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/plugin"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
@@ -628,6 +629,37 @@ func TestPluginSync(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// See https://github.com/mattermost/mattermost-server/issues/19189
|
||||
func TestChannelsPluginsInit(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
runNoPanicTest := func(t *testing.T) {
|
||||
ctx := request.EmptyContext()
|
||||
path, _ := fileutils.FindDir("tests")
|
||||
|
||||
require.NotPanics(t, func() {
|
||||
th.Server.Channels().initPlugins(ctx, path, path)
|
||||
})
|
||||
}
|
||||
|
||||
t.Run("no panics when plugins enabled", func(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.PluginSettings.Enable = true
|
||||
})
|
||||
|
||||
runNoPanicTest(t)
|
||||
})
|
||||
|
||||
t.Run("no panics when plugins disabled", func(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.PluginSettings.Enable = false
|
||||
})
|
||||
|
||||
runNoPanicTest(t)
|
||||
})
|
||||
}
|
||||
|
||||
func TestSyncPluginsActiveState(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user