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

The connection adder thread pool is permanently blocked #2186

Open
x2zh opened this issue Mar 7, 2024 · 0 comments
Open

The connection adder thread pool is permanently blocked #2186

x2zh opened this issue Mar 7, 2024 · 0 comments

Comments

@x2zh
Copy link

x2zh commented Mar 7, 2024

The connection adder thread pool size is 1. If an error occurs in the jdbc driver and is permanently blocked in creating a connection, then the entire connection pool creation of new connections will be blocked. Even if the subsequent abnormality is recovered, the connection pool cannot return to normal.

      this.addConnectionExecutor = createThreadPoolExecutor(addConnectionQueue, poolName + " connection adder", threadFactory, new ThreadPoolExecutor.DiscardPolicy());
public static ThreadPoolExecutor createThreadPoolExecutor(final BlockingQueue<Runnable> queue, final String threadName, ThreadFactory threadFactory, final RejectedExecutionHandler policy)
   {
      if (threadFactory == null) {
         threadFactory = new DefaultThreadFactory(threadName, true);
      }

      ThreadPoolExecutor executor = new ThreadPoolExecutor(1 /*core*/, 1 /*max*/, 5 /*keepalive*/, SECONDS, queue, threadFactory, policy);
      executor.allowCoreThreadTimeOut(true);
      return executor;
   }

kohlschutter/junixsocket#154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant