mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Use cachedThreadPool which uses SynchronousQueue instead of ArrayBlockingQueue.
When ArrayBlockingQueue is used (as in case of using Utilities.getListeningExecutorService) the maxPoolSize has no effect. The pool creates never more threads than the core pool size. Thus we have been limited to 15 threads for message sending and connection creation. This was likely a reason why seed nodes are not accepting new connections if the pool is exhausted. Slow message send can block a thread for 1-3 minutes. Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
071a352443
commit
f90c4b8f6b
1 changed files with 3 additions and 5 deletions
|
@ -439,11 +439,9 @@ public abstract class NetworkNode implements MessageListener {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void createExecutorService() {
|
||||
if (executorService == null)
|
||||
executorService = Utilities.getListeningExecutorService("NetworkNode-" + servicePort,
|
||||
maxConnections * 2,
|
||||
maxConnections * 4,
|
||||
60);
|
||||
if (executorService == null) {
|
||||
executorService = MoreExecutors.listeningDecorator(Utilities.newCachedThreadPool(maxConnections * 4, 3, TimeUnit.MINUTES));
|
||||
}
|
||||
}
|
||||
|
||||
void startServer(ServerSocket serverSocket) {
|
||||
|
|
Loading…
Add table
Reference in a new issue