;;not the list). Multiple threads getting to this test at the
;;same time might result in the free-connections getting
;;longer... meh.
- ((>= (length (free-connections pool))
- *db-pool-max-free-connections*)
+ ((and *db-pool-max-free-connections*
+ (>= (length (free-connections pool))
+ *db-pool-max-free-connections*))
(%pool-force-disconnect database)
(with-process-lock ((conn-pool-lock pool) "Remove extra Conn")
(setf (all-connections pool)
(database-execute-command "DISCARD ALL" database)))))
(defun clear-conn-pool (pool)
+ "Be careful this function will disconnect connections without regard
+to whether another thread is actively using them."
(with-process-lock ((conn-pool-lock pool) "Clear pool")
(mapc #'%pool-force-disconnect (all-connections pool))
(setf (all-connections pool) nil