diff --git a/zfs/zfscmd/zfscmd.go b/zfs/zfscmd/zfscmd.go index d07c605..1cbc9ed 100644 --- a/zfs/zfscmd/zfscmd.go +++ b/zfs/zfscmd/zfscmd.go @@ -125,14 +125,16 @@ func (c *Cmd) startPre(newTask bool) { } func (c *Cmd) startPost(err error) { - now := time.Now() - c.mtx.Lock() + now := time.Now() c.startedAt = now - c.mtx.Unlock() startPostReport(c, err, now) startPostLogging(c, err, now) + + if err != nil { + c.waitReturnEndSpanCb() + } } func (c *Cmd) waitPre() {