{"record":{"id":"99526ace91d0f8f9","repo":"brettwooldridge/HikariCP","slug":"poolname-is-not-suspendable","errorCode":null,"errorMessage":"${poolName} - is not suspendable","messagePattern":"(.+?) - is not suspendable","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/main/java/com/zaxxer/hikari/pool/HikariPool.java","lineNumber":391,"sourceCode":"   @Override\n   public int getThreadsAwaitingConnection()\n   {\n      return connectionBag.getWaitingThreadCount();\n   }\n\n   /** {@inheritDoc} */\n   @Override\n   public void softEvictConnections()\n   {\n      connectionBag.values().forEach(poolEntry -> softEvictConnection(poolEntry, \"(connection evicted)\", false /* not owner */));\n   }\n\n   /** {@inheritDoc} */\n   @Override\n   public synchronized void suspendPool()\n   {\n      if (suspendResumeLock == SuspendResumeLock.FAUX_LOCK) {\n         throw new IllegalStateException(poolName + \" - is not suspendable\");\n      }\n      else if (poolState != POOL_SUSPENDED) {\n         suspendResumeLock.suspend();\n         poolState = POOL_SUSPENDED;\n      }\n   }\n\n   /** {@inheritDoc} */\n   @Override\n   public synchronized void resumePool()\n   {\n      if (poolState == POOL_SUSPENDED) {\n         poolState = POOL_NORMAL;\n         fillPool(false);\n         suspendResumeLock.resume();\n      }\n   }\n","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/brettwooldridge/HikariCP/blob/a4d93f4f85517f90e632b795486d7102e933d7ff/src/main/java/com/zaxxer/hikari/pool/HikariPool.java#L373-L409","documentation":"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.","triggerScenarios":"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.","commonSituations":"Using HikariCP MBeans to suspend during failover/maintenance while forgetting the config flag; rolling restart tooling that assumes suspension is available.","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"],"exampleFix":"// before\nHikariConfig cfg = new HikariConfig();\n// allowPoolSuspension defaults to false\nhikariPoolMXBean.suspendPool(); // IllegalStateException\n\n// after\ncfg.setAllowPoolSuspension(true);\nHikariDataSource ds = new HikariDataSource(cfg);\nhikariPoolMXBean.suspendPool(); // works; remember to resumePool() after","handlingStrategy":"validation","validationCode":"HikariConfig cfg = new HikariConfig();\ncfg.setAllowPoolSuspension(true); // required before suspendPool() can work","typeGuard":null,"tryCatchPattern":"try { mxBean.suspendPool(); }\ncatch (IllegalStateException e) {\n    if (e.getMessage().contains(\"is not suspendable\")) { /* enable flag and recreate pool */ }\n}","preventionTips":["Enable allowPoolSuspension when tooling will suspend","Check isAllowPoolSuspension() via MXBean before suspend","Always pair suspendPool() with resumePool() in finally"],"tags":["hikaricp","pool","suspension","configuration","jmx"],"backgroundTag":null,"analyzedSha":"a4d93f4f85517f90e632b795486d7102e933d7ff","analyzedAt":"2026-08-14T12:11:37.292Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}