mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +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:
parent
71b69c36d5
commit
9d3ec58370
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user