修复插件资源限制失败阻塞主服务

This commit is contained in:
smail 2026-09-30 01:10:13 +08:00
parent 25cf1478f0
commit f23af282ca

View File

@ -375,19 +375,16 @@ func Init(serverVersion string) {
continue
}
launchSpec.closeParentFiles()
if limitErr := applyPluginResourceLimits(process); limitErr != nil {
log.Warnf("[%s] Plugin resource limits could not be applied", logicalID)
_ = process.Kill()
_, _ = process.Wait()
launchSpec.cleanup()
continue
}
processListMu.Lock()
processList = append(processList, process)
processListMu.Unlock()
pluginNo++
go waitPlugin(process, logicalID, socketPath, launchSpec)
if limitErr := applyPluginResourceLimits(process); limitErr != nil {
log.Warnf("[%s] Plugin resource limits could not be applied", logicalID)
_ = process.Kill()
continue
}
if !waitPluginSocket(socketPath) {
log.Warnf("[%s] Plugin socket was not created", logicalID)