Skip to content

Commit

Permalink
store/tikv: set execution timeout for general TiKV requests (#24936)
Browse files Browse the repository at this point in the history
  • Loading branch information
sticnarf authored May 28, 2021
1 parent ec12617 commit 138692f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions store/tikv/region_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ func (s *RegionRequestSender) SendReqCtx(
}
})

// If the MaxExecutionDurationMs is not set yet, we set it to be the RPC timeout duration
// so TiKV can give up the requests whose response TiDB cannot receive due to timeout.
if req.Context.MaxExecutionDurationMs == 0 {
req.Context.MaxExecutionDurationMs = uint64(timeout.Milliseconds())
}

tryTimes := 0
for {
if (tryTimes > 0) && (tryTimes%1000 == 0) {
Expand Down

0 comments on commit 138692f

Please sign in to comment.