-
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: fix index lookup join hang #6267
Conversation
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.
@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 { |
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.
we should close iw.taskCh
to let outer workers stop running as soon as possible.
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.
When the caller received the error, it will close the executor, then the context will be canceled, all workers will quit.
Without the fix, the test blocks forever. |
executor/index_lookup_join_test.go
Outdated
import ( | ||
. "github.com/pingcap/check" | ||
"github.com/pingcap/tidb/util/testkit" | ||
"context" |
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.
fix import format
LGTM |
/run-all-tests |
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-tests tidb-test=pr/493 |
/run-integration-common-test |
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.