Skip to content

Commit 8ee050d

Browse files
craig[bot]yuzefovich
andcommitted
Merge #157802
157802: colexecjoin: add cancel check when consuming right input in cross join r=yuzefovich a=yuzefovich We just saw a test failure where the query wasn't cancelled within 1 minute even though 0.1s statement timeout is set. In the goroutine dump we see the cross joiner building from the left input. We already check for cancellation every time Next is called on the cross joiner, at the beginning, but on the very first call there could be a long process to consume the right input. This commit adds the cancel checking before fetching the next batch from the right input (except for the first batch that might have already been fetched). I was unable to reproduce the timeout, but this shouldn't hurt. Fixes: #156992. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 62bb107 + 1b0a291 commit 8ee050d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/sql/colexec/colexecjoin/crossjoiner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ func (c *crossJoiner) consumeRightInput(ctx context.Context) {
175175
// Consume the right input if necessary.
176176
if needRightTuples || needOnlyNumRightTuples {
177177
for {
178+
c.cancelChecker.CheckEveryCall()
178179
batch := c.InputTwo.Next()
179180
if needRightTuples {
180181
c.rightTuples.Enqueue(ctx, batch)

0 commit comments

Comments
 (0)