Lucee creates duplicate datasource pools - jmx storm with fusion Reactor

When a <cfquery> tag specifies username and password attributes that are identical to the credentials already embedded in the server-level datasource, Lucee creates a second, separate connection pool for the same datasource instead of reusing the registered server-level pool.

Under concurrent load the duplicate pool is regularly evicted (60-second idle timeout hardcoded in ConfigImpl.POOL_MAX_IDLE), then recreated — triggering the jmxRegister retry storm described in POOL-393 on every eviction/burst cycle. Commons-pool2 library is updated in Lucee 7 so this impact isn’t as high as seen in Lucee 6

Reproduction: GitHub - deanmaunder/lucee-pool-shadow · GitHub

1 Like

excellent bug report!

Firstly, I’ve fixed the pool stats reporting to show this problem

measure first, cut twice as they say

Fixed

https://luceeserver.atlassian.net/browse/LDEV-6296

Standalone reproduction harness exercises 500 datasources with a sequential warmup followed by a barrier-synced concurrent matching-cred burst. AMD 9950x3d, 32 hardware threads.

Branch commons-pool2 Warmup Burst Burst/Warmup Pool delta MBean delta
6.2 pre-fix (6.2.7.12) 2.9.0 2255 ms 2413 ms 1.07× slower +495 +500
6.2 post-fix (6.2.7.14) 2.9.0 2271 ms 53 ms 43× faster +0 +0
7.0 pre-fix (7.0.4.29) 2.12.1 1634 ms 2015 ms 1.23× slower +500 +500
7.0 post-fix (7.0.4.30) 2.12.1 1559 ms 317 ms 5× faster +0 +0
7.1 pre-fix (7.1.0.110) 2.12.1 2059 ms 6169 ms (median, 2.2–40s range) slower +500 +500
7.1 post-fix (7.1.0.111) 2.12.1 2528 ms 87 ms 29× faster +0 +0

Post-fix figures are medians of 3 consistent runs. Pre-fix 7.1 burst is median of 5 runs because of massive run-to-run variance (range column).

Key signals:

  • Pool/MBean delta goes from +495–500 (every burst created N shadow pools) to deterministic +0 across all branches. Trigger is gone.
  • Burst time flips from slower-than-sequential (JMX MBeanServer serialisation under concurrent register attempts) to faster-than-sequential (actual parallel speedup, because there’s nothing being registered).
  • Storm magnitude on pre-fix 7.1 spans 18× run-to-run (2.2s–40s); that variance is gone post-fix.
  • Connection budget for an affected datasource is now deterministic at the configured connectionLimit instead of sometimes-doubling.

The createId() normalisation removes the trigger uniformly across all three branches regardless of commons-pool2 version. POOL-393 (commons-pool2 2.12.0+) was helping but never enough to mask the underlying serialisation; the only durable fix is not creating the duplicate pool in the first place.

1 Like

Amazing! Thank you.