-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.8.0
-
Component/s: None
-
None
-
Fully Compatible
The following is a bit of a corner case, but I think it's related to an issue we've seen in practice (if you e.g. have a mongod which is still bound to a port but not actually accept()ing connections). Steps to reproduce:
- Run a netcat:
$ nc -lk localhost 7000 - Use that netcat as the first node in your replica set:
>> m = Mongo::ReplSetConnection.new(['127.0.0.1', 7000], ['127.0.0.1', 6001]) - This will hang forever.
- That's fine; set a :connect_timeout. Still hangs forever because under the hood, it's doing a read from the netcat session to learn about the cluster config.
- Set an :op_timeout. An exception is raised (in particular, the next seed node is not tried).
Is there an option for this case I'm missing? It seems like it might be worth making :connect_timeout be applicable until the connection instantiation has completed.