Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose whether pool is suspended in MXBean #1940

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/com/zaxxer/hikari/HikariPoolMXBean.java
Expand Up @@ -65,6 +65,11 @@ public interface HikariPoolMXBean
*/
int getThreadsAwaitingConnection();

/**
* Returns whether the pool is currently suspended.
*/
boolean isSuspended();

/**
* Evict currently idle connections from the pool, and mark active (in-use) connections for eviction when they are
* returned to the pool.
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/zaxxer/hikari/pool/HikariPool.java
Expand Up @@ -368,6 +368,13 @@ public int getThreadsAwaitingConnection()
return connectionBag.getWaitingThreadCount();
}

/** {@inheritDoc} */
@Override
public boolean isSuspended()
{
return poolState == POOL_SUSPENDED;
}

/** {@inheritDoc} */
@Override
public void softEvictConnections()
Expand Down