Skip to content

Commit

Permalink
test: try with dynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Feb 15, 2024
1 parent 56e762c commit 4493cc5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ && getServer().getOptions().getSslMode().isSslEnabled()
String.format(
"Exception on connection handler with ID %s for client %s: %s",
getName(),
socket == null ? "(none)" : socket.getInetAddress().getHostAddress(),
socket == null || socket.getInetAddress() == null
? "(none)"
: socket.getInetAddress().getHostAddress(),
e));
} finally {
if (result != RunConnectionState.RESTART_WITH_SSL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down Expand Up @@ -85,7 +85,12 @@ public class ProxyServer extends AbstractApiService {
private final AtomicInteger debugMessageCount = new AtomicInteger();

private final ExecutorService createConnectionHandlerExecutor =
new ThreadPoolExecutor(1, Integer.MAX_VALUE, 20L, TimeUnit.SECONDS, new SynchronousQueue<>());
new ThreadPoolExecutor(
1,
Runtime.getRuntime().availableProcessors(),
20L,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>());

/**
* Instantiates the ProxyServer from CLI-gathered metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ public void testImplicitBatchOfClientSideStatements() throws SQLException {

@Test
public void testConnectStorm() throws Exception {
int numThreads = 1000;
int numThreads = Runtime.getRuntime().availableProcessors() * 10;
ListeningExecutorService service =
MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numThreads));
List<ListenableFuture<Void>> futures = new ArrayList<>(numThreads);
Expand Down

0 comments on commit 4493cc5

Please sign in to comment.