lidavidm commented on code in PR #402:
URL: https://github.com/apache/arrow-adbc/pull/402#discussion_r1088220842
##########
go/adbc/driver/flightsql/flightsql_adbc.go:
##########
@@ -111,14 +114,33 @@ func (d Driver) NewDatabase(opts map[string]string)
(adbc.Database, error) {
return nil, adbc.Error{Msg: err.Error(), Code:
adbc.StatusInvalidArgument}
}
+ // Use WithBlock to surface connection errors eagerly
+ // Use WithMaxMsgSize(16 MiB) since Flight services tend to send large
messages
+ db.dialOpts.block = true
+ db.dialOpts.maxMsgSize = 16 * 1024 * 1024
+
return db, db.SetOptions(opts)
}
+type dbDialOpts struct {
+ opts []grpc.DialOption
+ block bool
+ maxMsgSize int
+}
+
+func (d *dbDialOpts) rebuild() {
+ d.opts =
[]grpc.DialOption{grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(d.maxMsgSize))}
+ if d.block {
+ d.opts = append(d.opts, grpc.WithBlock())
+ }
+}
Review Comment:
Done
--
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]