Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
  • Loading branch information
solotzg committed Sep 4, 2024
1 parent affde21 commit f36bc7a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/executor/join/index_lookup_hash_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type IndexNestedLoopHashJoin struct {
// panicErr records the error generated by panic recover. This is introduced to
// return the actual error message instead of `context cancelled` to the client.
panicErr struct {
sync.Mutex
atomic.Bool
error
}
Expand Down Expand Up @@ -198,8 +199,15 @@ func (e *IndexNestedLoopHashJoin) finishJoinWorkers(r any) {
if recoverdErr, ok := r.(error); ok {
err = recoverdErr
}
e.panicErr.error = err
e.panicErr.Store(true)

if !e.panicErr.Load() {
e.panicErr.Lock()
if !e.panicErr.Load() {
e.panicErr.error = err
e.panicErr.Store(true)
}
e.panicErr.Unlock()
}

if !e.KeepOuterOrder {
e.resultCh <- &indexHashJoinResult{err: err}
Expand Down

0 comments on commit f36bc7a

Please sign in to comment.