brettwooldridge/HikariCP · error · IllegalStateException
${poolName} - is not suspendable
Error message
${poolName} - is not suspendable What it means
suspendPool() throws IllegalStateException when the pool was created without allowPoolSuspension=true, because such pools use SuspendResumeLock.FAUX_LOCK (a no-op) and cannot actually suspend. Suspension replaces a semaphore, so it must be enabled at config time.
Source
Thrown at src/main/java/com/zaxxer/hikari/pool/HikariPool.java:391
@Override
public int getThreadsAwaitingConnection()
{
return connectionBag.getWaitingThreadCount();
}
/** {@inheritDoc} */
@Override
public void softEvictConnections()
{
connectionBag.values().forEach(poolEntry -> softEvictConnection(poolEntry, "(connection evicted)", false /* not owner */));
}
/** {@inheritDoc} */
@Override
public synchronized void suspendPool()
{
if (suspendResumeLock == SuspendResumeLock.FAUX_LOCK) {
throw new IllegalStateException(poolName + " - is not suspendable");
}
else if (poolState != POOL_SUSPENDED) {
suspendResumeLock.suspend();
poolState = POOL_SUSPENDED;
}
}
/** {@inheritDoc} */
@Override
public synchronized void resumePool()
{
if (poolState == POOL_SUSPENDED) {
poolState = POOL_NORMAL;
fillPool(false);
suspendResumeLock.resume();
}
}
View on GitHub (pinned to a4d93f4f85)
Solutions
- Set allowPoolSuspension=true in the pool config before creating the DataSource
- Remember suspension requires care: after suspend, you should usually resume promptly and connections queued via acquire will block (consider com.zaxxer.hikari.throwIfSuspended)
- If you did not intend to suspend, fix the calling code (monitoring/JMX client) that invokes suspendPool
- Verify via HikariConfigMXBean.isAllowPoolSuspension() before calling suspend
Example fix
// before HikariConfig cfg = new HikariConfig(); // allowPoolSuspension defaults to false hikariPoolMXBean.suspendPool(); // IllegalStateException // after cfg.setAllowPoolSuspension(true); HikariDataSource ds = new HikariDataSource(cfg); hikariPoolMXBean.suspendPool(); // works; remember to resumePool() after
Defensive patterns
Strategy: validation
Validate before calling
HikariConfig cfg = new HikariConfig(); cfg.setAllowPoolSuspension(true); // required before suspendPool() can work
Try / catch
try { mxBean.suspendPool(); }
catch (IllegalStateException e) {
if (e.getMessage().contains("is not suspendable")) { /* enable flag and recreate pool */ }
} Prevention
- Enable allowPoolSuspension when tooling will suspend
- Check isAllowPoolSuspension() via MXBean before suspend
- Always pair suspendPool() with resumePool() in finally
When it happens
Trigger: Calling HikariPool.suspendPool() (via JMX MBean hikariConfigMXBean or programmatically) when allowPoolSuspension was left at default false; Dropwizard/ops tooling trying to pause a pool for DB maintenance.
Common situations: Using HikariCP MBeans to suspend during failover/maintenance while forgetting the config flag; rolling restart tooling that assumes suspension is available.
Related errors
- poolName cannot contain ':' when used with JMX
- connectionTimeout cannot be less than ${SOFT_TIMEOUT_FLOOR}m
- idleTimeout cannot be negative
- maxPoolSize cannot be less than 1
- minimumIdle cannot be negative
AI-assisted analysis of brettwooldridge/HikariCP@a4d93f4f85 (2026-08-14).
Data as JSON: /api/errors/99526ace91d0f8f9.
Report an issue: GitHub.