From a43eef52ce5fb3d39bef7903d6683dca50feee43 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Mon, 11 Jul 2022 19:41:05 +0800 Subject: [PATCH] cherry pick #35820 to release-5.4 Signed-off-by: ti-srebot --- executor/index_lookup_hash_join.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/executor/index_lookup_hash_join.go b/executor/index_lookup_hash_join.go index 8a482fa1a8836..5f513998dd5da 100644 --- a/executor/index_lookup_hash_join.go +++ b/executor/index_lookup_hash_join.go @@ -626,7 +626,10 @@ func (iw *indexHashJoinInnerWorker) handleTask(ctx context.Context, task *indexH if task.keepOuterOrder { if err != nil { joinResult.err = err - resultCh <- joinResult + select { + case <-ctx.Done(): + case resultCh <- joinResult: + } } close(resultCh) }