-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: use goroutine pool to avoid runtime.morestack #3753
Conversation
23c762e
to
ae70f39
Compare
ae70f39
to
a636621
Compare
@tiancaiamao |
I'll fix it in make leak
@tiancaiamao |
@@ -43,6 +44,8 @@ const ( | |||
minLogDuration = 50 * time.Millisecond | |||
) | |||
|
|||
var xIndexSelectGP = gp.New(3 * time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use diffrent idleTimeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter whether it 2mins or 3mins or anything.
reserveStack(false) | ||
for _, batch1 := range batches { | ||
|
||
batch := batch1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just use batch1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good habit ! @winkyao
When using closure along with range operation, it's easy to get suck:
arr := []int{1, 2, 3, 4}
for _, v := range arr {
go func() {
fmt.Println(v) // guess the result?
}()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-test |
Maybe this branch works, you can have a try. @siddontang