max_pool_size is normally an integer, but it's set to
None if you're still using one of the deprecated classes,
ReplicaSetConnection, instead of the new classes
MongoReplicaSetClient. It so happens that in Python 2,
None is less than all integers, so this comparison in our connection pool is wrong, but doesn't raise:
def return_socket(self, sock): if len(self.sockets) < self.max_size: self.sockets.add(sock)
In Python 3 this raises:
TypeError: unorderable types: int() < NoneType()
Some third-party libraries like Kombu are compatible with Python 3, but still use the old PyMongo connection classes, revealing this bug.
If you use the old classes directly or via a third-party library, or if you set
None in your own code, please upgrade immediately to get proper connection pooling.