With the non-blocking asynchronous mongo java/scala driver, it is possible to define a wait time and a wait queue size for operations that cannot be executed directly with a free connection. When settings these values, the mongo driver will make the threads waiting for an available connection.
This behavior is very dangerous for an application written with non-blocking asynchronous IO in mind. These applications use a very limited number of threads (= numbers of cores). Blocking one of these thread can block the whole application.
What would be the recommended way to for this kind of applications? Should we set all these waiting settings to 0 and handle MongoWaitQueueFullException with retries in the application? Should the driver call an application callback when a connection is free?