Add afterSendReqToRegion failpoint (#780)

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
This commit is contained in:
MyonKeminta 2023-04-26 15:50:11 +08:00 committed by GitHub
parent 35c1ee47c4
commit 2be71b35ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1211,6 +1211,13 @@ func (s *RegionRequestSender) SendReqCtx(
return nil, nil, retryTimes, err
}
if _, err1 := util.EvalFailpoint("afterSendReqToRegion"); err1 == nil {
if hook := bo.GetCtx().Value("sendReqToRegionFinishHook"); hook != nil {
h := hook.(func(*tikvrpc.Request, *tikvrpc.Response, error))
h(req, resp, err)
}
}
// recheck whether the session/query is killed during the Next()
boVars := bo.GetVars()
if boVars != nil && boVars.Killed != nil && atomic.LoadUint32(boVars.Killed) == 1 {