mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-08 12:18:57 +00:00
runtime: make sure the "Shutdown" trace span have a correct end
We only added span.End() in the main process of the shim2 Shutdown method. The "Shutdown" span would keep alive, when the containers number is not 0. This PR make sure the "Shutdown" trace span have a correct end. Fixes: #2930 Signed-off-by: wangyongchao.bj <wangyongchao.bj@inspur.com>
This commit is contained in:
@@ -935,6 +935,10 @@ func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (_ *
|
||||
s.mu.Lock()
|
||||
if len(s.containers) != 0 {
|
||||
s.mu.Unlock()
|
||||
|
||||
span.End()
|
||||
katatrace.StopTracing(s.rootCtx)
|
||||
|
||||
return empty, nil
|
||||
}
|
||||
s.mu.Unlock()
|
||||
|
Reference in New Issue
Block a user