Skip to content

Commit 3c91d30

Browse files
Merge pull request #4446 from eslutsky/USHIFT-5295-strace
USHIFT-5295: Add trace log when service terminated abruptly
2 parents 2adae64 + 87d62ce commit 3c91d30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/servicemanager/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"runtime/debug"
78
"syscall"
89
"time"
910

@@ -112,7 +113,7 @@ func (m *ServiceManager) asyncRun(ctx context.Context, service Service) (<-chan
112113
go func() {
113114
defer func() {
114115
if r := recover(); r != nil {
115-
klog.Errorf("%s panicked: %s", service.Name(), r)
116+
klog.Errorf("%s panicked: %s trace: %s.", service.Name(), r, debug.Stack())
116117
klog.Error("Stopping MicroShift")
117118
if err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM); err != nil {
118119
klog.Warningf("error killing process: %v", err)

0 commit comments

Comments
 (0)