Merge pull request #4829 from LetFu/fix/addUnlock

runtime: add unlock before return in sendReq
This commit is contained in:
Bin Liu 2022-08-08 14:42:44 +08:00 committed by GitHub
commit 9516286f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2015,11 +2015,13 @@ func (k *kataAgent) sendReq(spanCtx context.Context, request interface{}) (inter
k.Lock()
if k.reqHandlers == nil {
k.Unlock()
return nil, errors.New("Client has already disconnected")
}
handler := k.reqHandlers[msgName]
if msgName == "" || handler == nil {
k.Unlock()
return nil, errors.New("Invalid request type")
}