-
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
executor: range task channel in XSelectIndexExec.Close. #2775
Conversation
@shenli @tiancaiamao PTAL |
@@ -505,11 +517,6 @@ func (e *XSelectIndexExec) nextForDoubleRead() (*Row, error) { | |||
} | |||
row, err := e.taskCurr.getRow() | |||
if err != nil { | |||
// Consume the task channel in case channel is full. |
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 clean the chan?
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 is moved to Close method.
// leak. For testing distsql with multiple regions, we need to manually split a mock TiKV. | ||
func (s *testSuite) TestIndexDoubleReadClose(c *C) { | ||
if _, ok := s.store.GetClient().(*tikv.CopClient); !ok { | ||
// Make sure the store is tikv store. |
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.
Should we assert ok is True here? Or the test case may be ignored.
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.
The test can be configured to run with localstore, then the client is not *tikv.CopClient
.
LGTM |
@tiancaiamao @zimulala PTAL |
LGTM |
LGTM |
Fixes goroutine leak.