projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb1a3c9
)
Cap spawn at max
author
Alan T. DeKok
<aland@freeradius.org>
Wed, 7 May 2014 11:18:40 +0000
(07:18 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Wed, 7 May 2014 11:18:40 +0000
(07:18 -0400)
src/main/connection.c
patch
|
blob
|
history
diff --git
a/src/main/connection.c
b/src/main/connection.c
index
d17ea3d
..
737bf7f
100644
(file)
--- a/
src/main/connection.c
+++ b/
src/main/connection.c
@@
-822,10
+822,15
@@
static int fr_connection_pool_check(fr_connection_pool_t *pool)
} else if (idle <= pool->spare) {
/*
* Not enough spare connections. Spawn a few.
+ * But cap the pool size at "max"
*/
spawn = pool->spare - idle;
extra = 0;
+ if ((pool->num + spawn) > pool->max) {
+ spawn = pool->max - pool->num;
+ }
+
} else if ((pool->min + extra) >= pool->num) {
/*
* If closing the extra connections would take us