No suitable servers found (`serverselectiontryonce` set): [connection error calling ismaster on '127.0.0.1:27017']: generic server error

3,798 views
Skip to first unread message

tmdb

unread,
Mar 17, 2016, 4:29:23 PM3/17/16
to mongodb-dev
Compiling master cxx driver on CentOS 6.5
streaming bulk write operations to insert into mongodb3.2 w/WiredTiger, client/server on same machine, 1000 inserts per bulk operation

after running for several minutes, the system generates the following exception

No suitable servers found (`serverselectiontryonce` set): [connection error calling ismaster on '127.0.0.1:27017']: generic server error


I have followed the proposed resolution here (https://github.com/mongodb/mongo-php-driver/issues/133) but with no success. That means that I have tried both removing ::1 localhost from /etc/hosts and also tried enabling --ipv6 in mongod


Is anybody else experiencing this issue?



tmdb

unread,
Mar 19, 2016, 2:08:55 PM3/19/16
to mongodb-dev
This was a result of the following conditions:

The data generation process used multiple threads to each stream bulk insert operations to a stand-alone instance of mongod using write_concern of k_unacknowledged. Using k_unacknowledged prevents the driver from throttling requests, so mongod fell behind. It appears to cache the bulk operations. When this exception occurred the cxx driver will throw bulk_write_exception. 

additionally in my case, I was catching bulk_write_exception but continuing my loop using the same connection without closing/reopening. This caused the number of connections displayed by mongostat to continually grow as my application continued to run in this way. Killing my process resulted in mongod slowly "draining" the open connections back down to zero, apparently by executing the operations associated with them.
Reply all
Reply to author
Forward
0 new messages