exception pymongo.errors.AutoReconnect(message='', errors=None)¶ Raised when a connection to the database is lost and an attempt to auto-reconnect will be made.
In order to auto-reconnect you must handle this exception, recognizing that the operation which caused it has not necessarily succeeded. Future operations will attempt to open a new connection to the database (and will continue to raise this exception until the first successful connection is made).
exception pymongo.errors.AutoReconnect(message='', errors=None)¶
Raised when a connection to the database is lost and an attempt to auto-reconnect will be made.
In order to auto-reconnect you must handle this exception, recognizing that the operation which caused it has not necessarily succeeded. Future operations will attempt to open a new connection to the database (and will continue to raise this exception until the first successful connection is made).
连接丢失需要重连时将抛出这个错误,文档中说明了,必须要手动处理这个错误.比较好的处理
处理方式
https://gist.github.com/anthonywu/1696591
更新下 pymongo 到最新,试试