[#347] zfscmd: fix dangling trace Task on .Start() failure

fixes #347
This commit is contained in:
Christian Schwarz 2020-08-29 19:18:00 +02:00
parent 0f3da73ef1
commit af2d6579c5

View File

@ -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() {