[PATCH 11 of 12 cubicweb] [database/pool/ux] add a warning when max-connections-pool is too small

Laurent Peuch cortex at worlddomination.be
Tue Jan 7 13:30:46 CET 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1578399965 -3600
#      Tue Jan 07 13:26:05 2020 +0100
# Node ID 700d414ca5f1c620a3209c00fc31b0eee39944bc
# Parent  0b195a125db3d99f706f74241966ce0c8848e26d
# Available At https://hg.logilab.org/users/lpeuch/cubicweb
#              hg pull https://hg.logilab.org/users/lpeuch/cubicweb -r 700d414ca5f1
[database/pool/ux] add a warning when max-connections-pool is too small

diff --git a/cubicweb/server/repository.py b/cubicweb/server/repository.py
--- a/cubicweb/server/repository.py
+++ b/cubicweb/server/repository.py
@@ -378,6 +378,15 @@ class Repository(object):
             min_pool_timeout = config['min-connections-pool-timeout']
             pool_low_load_delay = config['connections-pool-low-load-delay']
             pool_close_delay = config['connections-pool-close-delay']
+
+            if not config.quick_start and max_pool_size < 5:
+                self.warning("the connection pool (connections-pooler-enabled) option is enable "
+                             "but the maximum number of connections (connections-pool-size) is "
+                             "inferior to 5 (it's currently '%s'). Load tests  have determine "
+                             "that you need at least a maximum number of 5 connections to avoid a "
+                             "deadlock situation. It is recommended that you increase this number "
+                             "to 5 by changed or setting the connections-pool-size option in your "
+                             "configuration file." % max_pool_size)
         else:
             cw_init_phase_max_pool_size = None
 



More information about the cubicweb-devel mailing list