lidavidm commented on code in PR #4955:
URL: https://github.com/apache/arrow-adbc/pull/4955#discussion_r4386043543


##########
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:
   I don't love heavy reliance on mocking for tests - it makes for brittle 
tests and makes the actual implementation much messier



-- 
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]

Reply via email to