Skip to content

Commit

Permalink
Remove deprecated option
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Jun 20, 2024
1 parent bad6a60 commit cb3bb29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
9 changes: 5 additions & 4 deletions docs/source/driver/flight_sql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,11 @@ These options map 1:1 with the options in FlightClientOptions:
certificate.

``adbc.flight.sql.client_option.with_block``
Whether connections should wait until connections are established,
or connect lazily when used. The latter is gRPC's default
behavior, but the driver defaults to eager connection to surface
errors earlier. Value should be ``true`` or ``false``.
.. warning:: This option is deprecated as gRPC itself has deprecated the
underlying option.

This option has no effect and will be removed in a future release.
Value should be ``true`` or ``false``.

``adbc.flight.sql.client_option.with_max_msg_size``
The maximum message size to accept from the server. The driver
Expand Down
19 changes: 2 additions & 17 deletions go/adbc/driver/flightsql/flightsql_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (

type dbDialOpts struct {
opts []grpc.DialOption
block bool
maxMsgSize int
authority string
}
Expand All @@ -52,9 +51,6 @@ func (d *dbDialOpts) rebuild() {
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(d.maxMsgSize),
grpc.MaxCallSendMsgSize(d.maxMsgSize)),
}
if d.block {
d.opts = append(d.opts, grpc.WithBlock())
}
if d.authority != "" {
d.opts = append(d.opts, grpc.WithAuthority(d.authority))
}
Expand Down Expand Up @@ -200,19 +196,8 @@ func (d *databaseImpl) SetOptions(cnOptions map[string]string) error {
delete(cnOptions, OptionTimeoutConnect)
}

if val, ok := cnOptions[OptionWithBlock]; ok {
if val == adbc.OptionValueEnabled {
d.dialOpts.block = true
} else if val == adbc.OptionValueDisabled {
d.dialOpts.block = false
} else {
return adbc.Error{
Msg: fmt.Sprintf("Invalid value for database option '%s': '%s'", OptionWithBlock, val),
Code: adbc.StatusInvalidArgument,
}
}
delete(cnOptions, OptionWithBlock)
}
// gRPC deprecated this and explicitly recommends against it
delete(cnOptions, OptionWithBlock)

if val, ok := cnOptions[OptionWithMaxMsgSize]; ok {
var err error
Expand Down
3 changes: 0 additions & 3 deletions go/adbc/driver/flightsql/flightsql_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ func (d *driverImpl) NewDatabase(opts map[string]string) (adbc.Database, error)
return nil, adbc.Error{Msg: err.Error(), Code: adbc.StatusInvalidArgument}
}

// Do not set WithBlock since it converts some types of connection
// errors to infinite hangs
// Use WithMaxMsgSize(16 MiB) since Flight services tend to send large messages
db.dialOpts.block = false
db.dialOpts.maxMsgSize = 16 * 1024 * 1024

db.options = make(map[string]string)
Expand Down

0 comments on commit cb3bb29

Please sign in to comment.