From f54241ba8732edd6031f4ef5778b2ad8ee0cc130 Mon Sep 17 00:00:00 2001 From: Brett Wooldridge Date: Sat, 23 Nov 2024 05:05:24 +0900 Subject: [PATCH] Update README, minor code cleanup. --- README.md | 18 +++++++++++++++++- .../com/zaxxer/hikari/pool/HikariPool.java | 3 +-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fd46d629..2239accf 100644 --- a/README.md +++ b/README.md @@ -426,6 +426,22 @@ Please read the [Rapid Recovery Guide](https://github.com/brettwooldridge/Hikari ---------------------------------------------------- +### :see_no_evil: Secret Properties + +HikariCP has several Java system properties that control various aspects of the pool. These properties are *completely unsupported* +for user manipulation. It is possible though unlikely that they may not exist in the future. This means: do not even think of opening +an issue of any kind if you have modified these properties. You have been warned. *In fact, pretend you never heard anything about +"secret properties".* + +| Property | Description | +|:----------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ``com.zaxxer.hikari.blockUntilFilled`` | When this property is set ``true`` *and* ``initializationFailTimeout`` is greater than 1, the pool will block during start until completely filled. | +| ``com.zaxxer.hikari.enableRequestBoundaries`` | When this property is set ``true``, HikariCP will bracket connection acquisition and return with calls to ``Connection.beginRequest()`` and ``Connection.endRequest()``. | +| ``com.zaxxer.hikari.housekeeping.period`` | This property controls the frequency of the housekeeping thread, represented in milliseconds. Really, don't mess with this. | +| ``com.zaxxer.hikari.useWeakReferences`` | When this property is set ``true`` it will force HikariCP to use ``WeakReference`` objects in the ``ConcurrentBag`` internal collection ThreadLocals and prevent the use of our ``FastList`` class, all to avoid TomCat warnings during redeploy. | + +Seriously, either don't use these properties or take on full responsibility for the consequences. + ### :rocket: Initialization You can use the ``HikariConfig`` class like so1: @@ -547,7 +563,7 @@ Don't forget the [Wiki](https://github.com/brettwooldridge/HikariCP/wiki) for ad ### Requirements - ⇒ Java 8+ (Java 6/7 artifacts are in maintenance mode)
+ ⇒ Java 11+ (Java 6/7/8 artifacts are in maintenance mode)
⇒ slf4j library
### Sponsors diff --git a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java index 765ed985..f69f0181 100644 --- a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java @@ -114,8 +114,7 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag ThreadFactory threadFactory = config.getThreadFactory(); final int maxPoolSize = config.getMaximumPoolSize(); - LinkedBlockingQueue addConnectionQueue = new LinkedBlockingQueue<>(maxPoolSize); - this.addConnectionExecutor = createThreadPoolExecutor(addConnectionQueue, poolName + ":connection-adder", threadFactory, new CustomDiscardPolicy()); + this.addConnectionExecutor = createThreadPoolExecutor(maxPoolSize, poolName + ":connection-adder", threadFactory, new CustomDiscardPolicy()); this.closeConnectionExecutor = createThreadPoolExecutor(maxPoolSize, poolName + ":connection-closer", threadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); this.leakTaskFactory = new ProxyLeakTaskFactory(config.getLeakDetectionThreshold(), houseKeepingExecutorService);