worryg0d commented on code in PR #1793:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1793#discussion_r1852436793
##########
query_executor.go:
##########
@@ -129,12 +145,13 @@ func (q *queryExecutor) executeQuery(qry ExecutableQuery)
(*Iter, error) {
func (q *queryExecutor) do(ctx context.Context, qry ExecutableQuery, hostIter
NextHost) *Iter {
selectedHost := hostIter()
rt := qry.retryPolicy()
+ specifiedHost := qry.GetHost()
var lastErr error
var iter *Iter
for selectedHost != nil {
host := selectedHost.Info()
- if host == nil || !host.IsUp() {
+ if (host == nil || !host.IsUp()) && specifiedHost == nil {
selectedHost = hostIter()
continue
}
Review Comment:
It makes sense not to send the query if the host is down. I added a check
before this if that immediately returns an `ErrNoConnections` when the
specified host is down.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]