rethinkdb / rethinkdb-go

Go language driver for RethinkDB
Apache License 2.0
1.65k stars 182 forks source link

Cluster discovery & rare connection leak fixes #483

Closed CMogilko closed 4 years ago

cquon commented 4 years ago

Just as a clarifying question on this,

if there is an error processing response, we close the channel (https://github.com/rethinkdb/rethinkdb-go/pull/483/files#diff-8f8a79f3f89c69a28dd878de98384cf9R289), On the next pool query is this channel marked as bad already? It seems like it is only being bad on the next time the channel tries to query and sees that it is closed.

Would this require client code to then query twice before that connection is marked as bad and it gets a new connection?

CMogilko commented 4 years ago

@cquon Connection marked bad if any net.Conn Read() or Write() or protocol encoding returns error. It will be closed a bit later.