From aa65d34c36e145cac1bef2afd1902a4f5d3e7896 Mon Sep 17 00:00:00 2001 From: Graeme Connell Date: Tue, 18 May 2021 11:06:21 -0600 Subject: [PATCH] Set min/max threads for backup/storage service. From https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html: When a new task is submitted in method execute(java.lang.Runnable), and fewer than corePoolSize threads are running, a new thread is created to handle the request, even if other worker threads are idle. If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full. Since we utilize an unbounded queue, we'll never hit the condition that the queue is full, so the pool will never grow past corePoolSize. Given that, explicitly state that our max is 1 thread. This should be a noop operationally. Thanks to https://github.com/dropwizard/dropwizard/pull/834 for building in warnings to help us find this. --- .../whispersystems/textsecuregcm/WhisperServerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index e1e11aa5d..ee7f6d2ca 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -395,8 +395,8 @@ public class WhisperServerService extends Application