Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store/copr: use non-buffered channel for coprocessor response #35988

Merged
merged 22 commits into from
Jul 15, 2022
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6759d85
store/copr: use non-buffered channel for coprocessor response
tiancaiamao Jul 6, 2022
6f95e16
Merge branch 'master' into nonbuffer-cop-chan
tiancaiamao Jul 6, 2022
5970be6
Merge branch 'master' into nonbuffer-cop-chan
tiancaiamao Jul 6, 2022
11068ad
Merge branch 'master' into nonbuffer-cop-chan
tiancaiamao Jul 13, 2022
7d1c881
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
e43df4d
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
8e1ed23
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
41acbad
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
7a78884
Merge branch 'master' into nonbuffer-cop-chan
hawkingrei Jul 14, 2022
a580d5e
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
0cc7a59
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
e2fbd10
Merge branch 'master' into nonbuffer-cop-chan
tiancaiamao Jul 14, 2022
16c224c
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
345ea97
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
e9631cc
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
2cec4f7
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
1d39341
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
8dfdb18
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
4ffb5d1
Merge branch 'master' into nonbuffer-cop-chan
hawkingrei Jul 14, 2022
9c4aff9
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 14, 2022
5ce73a8
Merge branch 'master' into nonbuffer-cop-chan
hawkingrei Jul 15, 2022
5140c8d
Merge branch 'master' into nonbuffer-cop-chan
ti-chi-bot Jul 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,7 @@ func (c *CopClient) Send(ctx context.Context, req *kv.Request, variables interfa
it.sendRate = util.NewRateLimit(2 * it.concurrency)
it.respChan = nil
} else {
capacity := it.concurrency
if enabledRateLimitAction {
// The count of cached response in memory is controlled by the capacity of the it.sendRate, not capacity of the respChan.
// As the worker will send finCopResponse after each task being handled, we make the capacity of the respCh equals to
// 2*it.concurrency to avoid deadlock in the unit test caused by the `MustExec` or `Exec`
capacity = it.concurrency * 2
}
// in paging request, a request will be returned in multi batches,
// enlarge the channel size to avoid the request blocked by buffer full.
if req.Paging {
if capacity < 2048 {
capacity = 2048
}
}
it.respChan = make(chan *copResponse, capacity)
it.respChan = make(chan *copResponse)
it.sendRate = util.NewRateLimit(it.concurrency)
}
it.actionOnExceed = newRateLimitAction(uint(it.sendRate.GetCapacity()))
Expand Down