Skip to content
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

exec: catch panics coming from CFetcher and columnarizer #38949

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

yuzefovich
Copy link
Member

Release note: None

@yuzefovich yuzefovich requested review from jordanlewis, asubiotto and a team July 17, 2019 23:50
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

I encountered a panic when running make testplannerlogic TESTCONFIG=local with "streaming" by default

panic: runtime error: index out of range [recovered]
	panic: runtime error: index out of range [recovered]
	panic: panic while executing 1 statements: SELECT * FROM _@_; caused by runtime error: index out of range

goroutine 9262 [running]:
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).closeWrapper(0xc00a5d6000, 0x72a5ec0, 0xc00577db80, 0x680e400, 0x8d4a210)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:727 +0x330
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1(0xc00a5d6000, 0x72a5ec0, 0xc00577db80)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:440 +0x61
panic(0x680e400, 0x8d4a210)
	/usr/local/opt/go/libexec/src/runtime/panic.go:522 +0x1b5
github.com/cockroachdb/cockroach/pkg/sql/exec.CatchVectorizedRuntimeError.func1(0xc0066cc1c8)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/exec/error.go:67 +0x5d8
panic(0x680e400, 0x8d4a210)
	/usr/local/opt/go/libexec/src/runtime/panic.go:522 +0x1b5
github.com/cockroachdb/cockroach/pkg/sql/row.(*CFetcher).processValue(0xc00837a000, 0x72a5f80, 0xc00a22e240, 0x0, 0xc007e35800, 0xc008572178, 0xc009a3e028, 0x1, 0x1, 0xc007d85680)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/row/cfetcher.go:788 +0x1335
github.com/cockroachdb/cockroach/pkg/sql/row.(*CFetcher).NextBatch(0xc00837a000, 0x72a5f80, 0xc00a22e240, 0xc007df0000, 0xc0066cbbc0, 0x5389bde, 0x0)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/row/cfetcher.go:629 +0x65b
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*colBatchScan).Next(0xc009afa9c0, 0x72a5f80, 0xc00a22e240, 0xed4c1aa84, 0x0)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/colbatch_scan.go:49 +0x47
github.com/cockroachdb/cockroach/pkg/sql/exec.(*CancelChecker).Next(0xc007e3b440, 0x72a5f80, 0xc00a22e240, 0x4, 0xd681890)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/exec/cancel_checker.go:40 +0x69
github.com/cockroachdb/cockroach/pkg/sql/exec.(*VectorizedStatsCollector).Next(0xc00240d590, 0x72a5f80, 0xc00a22e240, 0x0, 0x0)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/exec/stats.go:82 +0x7b
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*materializer).next(0xc002bc2300, 0x402e71f, 0x8, 0xc00642f300, 0x59e7a89)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/materializer.go:116 +0x451
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*materializer).nextAdapter(...)
	/Users/yahoryuzefovich/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/materializer.go:107
github.com/cockroachdb/cockroach/pkg/sql/exec.CatchVectorizedRuntimeError(0xc0066cc1d8, 0x0, 0x0)

and I think we want to catch such panics and turn them into errors in the future.

cc @rohany for the cause

@yuzefovich
Copy link
Member Author

I guess another thing to catch panics from is columnarizer. Thoughts?

@asubiotto
Copy link
Contributor

The columnarizer should always be upstream of a materializer, right?

@yuzefovich
Copy link
Member Author

Yes, we'll always have something like columnarizer -> operator -> materializer -> catch panics, but if a runtime panic occurs in columnarizer, the top of the call stack will be columnarizer, and the catcher will rethrow the panic.

@asubiotto
Copy link
Contributor

Ah true, that seems like a good idea.

@yuzefovich yuzefovich changed the title exec: catch panics coming from CFetcher exec: catch panics coming from CFetcher and columnarizer Jul 18, 2019
@yuzefovich
Copy link
Member Author

Included columnarizer as well.

@rohany
Copy link
Contributor

rohany commented Jul 18, 2019

I might know the cause of the panic — I’ll look into it tomorrow.

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

craig bot pushed a commit that referenced this pull request Jul 18, 2019
38949: exec: catch panics coming from CFetcher and columnarizer r=yuzefovich a=yuzefovich

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 18, 2019

Build succeeded

@craig craig bot merged commit 5ae858a into cockroachdb:master Jul 18, 2019
@yuzefovich yuzefovich deleted the cfetcher-panic branch July 19, 2019 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants