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

executor: fix index lookup join hang #6267

Merged
merged 2 commits into from
Apr 11, 2018
Merged

Conversation

coocood
Copy link
Member

@coocood coocood commented Apr 11, 2018

The index lookup join inner worker should keep consuming the task channel and should not return on error,
or the task channel maybe full and blocks forever.

The index lookup join inner worker should keep consuming the task channel and should not return on error,
or the task channel maybe full and blocks forever.
@coocood coocood added priority/P1 The issue has P1 priority. type/bugfix This PR fixes a bug. labels Apr 11, 2018
@coocood coocood added this to the 2.0 milestone Apr 11, 2018
@coocood
Copy link
Member Author

coocood commented Apr 11, 2018

@zz-jason @shenli @tiancaiamao PTAL

@@ -392,9 +392,6 @@ func (iw *innerWorker) run(ctx context.Context, wg *sync.WaitGroup) {

err := iw.handleTask(ctx, task)
task.doneCh <- errors.Trace(err)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should close iw.taskCh to let outer workers stop running as soon as possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the caller received the error, it will close the executor, then the context will be canceled, all workers will quit.

@coocood
Copy link
Member Author

coocood commented Apr 11, 2018

Without the fix, the test blocks forever.

import (
. "github.com/pingcap/check"
"github.com/pingcap/tidb/util/testkit"
"context"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix import format

@zz-jason
Copy link
Member

LGTM

@coocood
Copy link
Member Author

coocood commented Apr 11, 2018

/run-all-tests

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp
Copy link
Member

jackysp commented Apr 11, 2018

/run-all-tests tidb-test=pr/493

@coocood
Copy link
Member Author

coocood commented Apr 11, 2018

/run-integration-common-test

@coocood coocood merged commit d4d1851 into pingcap:master Apr 11, 2018
@coocood coocood deleted the fix-index-join branch April 11, 2018 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/P1 The issue has P1 priority. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants