Start the stack trap earlier for daemon
That way we can get stack dump earlier if there is something that locks the daemon during start/restore phase. Signed-off-by: Vincent Demeester <vincent@sbr.pm> Upstream-commit: 94d44066f3abb7c7eea7fcb81e8419ae7331d1fd Component: engine
This commit is contained in:
@@ -526,6 +526,14 @@ func NewDaemon(config *config.Config, registryService registry.Service, containe
|
||||
}
|
||||
}()
|
||||
|
||||
// set up SIGUSR1 handler on Unix-like systems, or a Win32 global event
|
||||
// on Windows to dump Go routine stacks
|
||||
stackDumpDir := config.Root
|
||||
if execRoot := config.GetExecRoot(); execRoot != "" {
|
||||
stackDumpDir = execRoot
|
||||
}
|
||||
d.setupDumpStackTrap(stackDumpDir)
|
||||
|
||||
if err := d.setupSeccompProfile(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -714,14 +722,6 @@ func NewDaemon(config *config.Config, registryService registry.Service, containe
|
||||
engineCpus.Set(float64(info.NCPU))
|
||||
engineMemory.Set(float64(info.MemTotal))
|
||||
|
||||
// set up SIGUSR1 handler on Unix-like systems, or a Win32 global event
|
||||
// on Windows to dump Go routine stacks
|
||||
stackDumpDir := config.Root
|
||||
if execRoot := config.GetExecRoot(); execRoot != "" {
|
||||
stackDumpDir = execRoot
|
||||
}
|
||||
d.setupDumpStackTrap(stackDumpDir)
|
||||
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user