Skip to content

Commit

Permalink
Fix hang on error
Browse files Browse the repository at this point in the history
Signed-off-by: Dirkjan Bussink <[email protected]>
  • Loading branch information
dbussink committed Oct 23, 2023
1 parent f23981a commit c77b904
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/vt/vtgate/engine/concatenate.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,15 @@ func (c *Concatenate) parallelStreamExec(inCtx context.Context, vcursor VCursor,
return callback(resultChunk, currIndex)
})
if err != nil {
muFields.Lock()
if rest[currIndex] == nil {
// In case we haven't received any fields yet, we need to set it
// empty, or otherwise we will keep waiting forever.
rest[currIndex] = &sqltypes.Result{}
}
cancel()
condFields.Broadcast()
muFields.Unlock()
}
return err
})
Expand Down

0 comments on commit c77b904

Please sign in to comment.