zeroshade commented on code in PR #4955:
URL: https://github.com/apache/arrow-adbc/pull/4955#discussion_r4403054897
##########
go/adbc/drivermgr/doc.go:
##########
@@ -19,4 +19,10 @@
//
// This provides an implementation of the ADBC interfaces which
// uses CGO to wrap a shared object implementation of adbc.h
+//
+// A query's execution context is watched while its result reader is consumed.
+// Release or exhaust the reader to stop watching. Reexecuting the statement
+// also stops the previous reader's watcher before starting the new execution.
+// Cancellation is best-effort and depends on support in the loaded driver.
+// Release a reader before closing the statement that produced it.
Review Comment:
Removed in 69d8b75.
##########
go/adbc/drivermgr/wrapper.go:
##########
@@ -453,16 +488,111 @@ func (c *cnxn) SetOption(key, value string) error {
type stmt struct {
st *C.struct_AdbcStatement
+
+ mu sync.Mutex // serializes cancellation and release
+ closed bool
+}
+
+var _ adbc.StatementExecuteSchema = (*stmt)(nil)
+
+// cancelStatement is a variable so tests can observe the real C cancellation
call.
+var cancelStatement = func(s *stmt) {
+ var err C.struct_AdbcError
+ C.AdbcStatementCancel(s.st, &err)
+ C.releaseErr(&err) // Cancellation is best-effort, including
NOT_IMPLEMENTED.
+}
Review Comment:
The `cancelStatement` test hook is gone; the tests now use the bundled
SQLite driver.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]