From 47b376956f7faef841393974690acfdf5f0893a4 Mon Sep 17 00:00:00 2001 From: heylongdacoder Date: Fri, 10 Dec 2021 19:45:17 +0800 Subject: [PATCH] Remove os.Kill in signal handling Signed-off-by: heylongdacoder --- src/jobservice/runtime/bootstrap.go | 2 +- src/pkg/scan/rest/v1/client_pool.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jobservice/runtime/bootstrap.go b/src/jobservice/runtime/bootstrap.go index c6573c6fcaa..5af9d6210c4 100644 --- a/src/jobservice/runtime/bootstrap.go +++ b/src/jobservice/runtime/bootstrap.go @@ -219,7 +219,7 @@ func (bs *Bootstrap) LoadAndRun(ctx context.Context, cancel context.CancelFunc) // Listen to the system signals sig := make(chan os.Signal, 1) - signal.Notify(sig, os.Interrupt, syscall.SIGTERM, os.Kill) + signal.Notify(sig, os.Interrupt, syscall.SIGTERM) terminated := false go func(errChan chan error) { defer func() { diff --git a/src/pkg/scan/rest/v1/client_pool.go b/src/pkg/scan/rest/v1/client_pool.go index eb93c5b6f2a..27ff01a1691 100644 --- a/src/pkg/scan/rest/v1/client_pool.go +++ b/src/pkg/scan/rest/v1/client_pool.go @@ -128,7 +128,7 @@ func (bcp *basicClientPool) deadCheck(key string, item *poolItem) { // As we do not have a global context, let's watch the system signal to // exit the goroutine correctly. sig := make(chan os.Signal, 1) - signal.Notify(sig, os.Interrupt, syscall.SIGTERM, os.Kill) + signal.Notify(sig, os.Interrupt, syscall.SIGTERM) tk := time.NewTicker(bcp.config.DeadCheckInterval) defer tk.Stop()