The maximum number of threads that the driver allows to have waiting in a queue for a connection from the pool is
_options.connectionsPerHost * _options.threadsAllowedToBlockForConnectionMultiplier
which defaults to 50 (10 * 5).
Past that number the driver throws a SemaphoresOut exception with the message "Out of semaphores to get db connection".
This is confusing to users, since the fact that the driver uses a semaphore to enforce this limit is not something users generally need to be aware of.
The driver should throw a less confusing exception with a message more like "Exceeded the maximum number of threads that may be waiting for a connection to become available from the pool. The maximum is calculated as the product of connectionsPerHost (10) and threadsAllowedToBlockForConnectionMultiplier (5) in com.mongodb.MongoOptions"