JVM crashes loading Go-based ADBC drivers under sustained load #4294
metegenez
started this conversation in
Show and tell
Replies: 1 comment 5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context
I've been working on an ADBC catalog connector for StarRocks (using
JniDriverFactoryon the JVM side; not yet upstream). This report is from running it under sustained TPC-H load against an Arrow Flight/MySQL target.TL;DR
Loading a Go-based ADBC driver (FlightSQL in my case) into a long-lived JVM via
JniDriverFactoryand running sustained workloads crashes the JVM with one of three signatures from what looks like the same bug class. I found a deployment configuration that holds at >800 sequential ADBC ops, but I haven't touched the JNI shim itself. Posting this as a field report and to ask whether anyone has hit it / has guidance.Setup
libadbc_driver_flightsql.soloaded viaorg.apache.arrow.adbc.driver.jni.JniDriverFactoryThree crash signatures, looks like one bug class
fatal error: found pointer to free objectinruntime.bgsweep— GC sweep finds zombie heap entriesSIGSEGV at addr=0x118inruntime.(*unwinder).next— stack walker derefs null when scanning a goroutine mid-cgo-callbackruntime.memmoveinbytes.(*Buffer).Writefrom gRPChpack.(*Encoder).WriteField— gRPCloopyWriterwrites into a freed Go buffer while encoding HTTP/2 headers for a new streamAll three look like the Go runtime catching freed-but-still-referenced state. Variation seems timing-driven: whichever goroutine happens to be running when the corruption surfaces.
What works (deployment hygiene only)
I have not modified the JNI shim. I pinned a build of the FlightSQL
.soand added two env vars at JVM launch:I also added a caller-side connection pool so the JVM doesn't churn
JniConnectionwrappers. With this combination I run 10× sustained TPCH benchmark cycles (≈880 ADBC ops) cleanly. Without it, crash within tens of ops.Why I think upstream hasn't seen this
JniDriverTest.javacovers happy-path open/close cycles only. No sustained-load run, noSystem.gc()pressure between iterations. A bug at this layer wouldn't surface there.Initial Performance on Starrocks Integration
We need to improve connection handling for ADBC and increase the scale factor for putting more workload on data read, since most of the queries requires much less data.
All reactions