From 1317613d23618531c4863bc1c0bb25eb3aabd21b Mon Sep 17 00:00:00 2001 From: Hellblazer Date: Thu, 6 Jun 2024 14:27:18 -0700 Subject: [PATCH] another attempt --- .../java/com/salesforce/apollo/choam/DynamicTest.java | 4 +--- .../test/java/com/salesforce/apollo/choam/TestCHOAM.java | 8 +++++--- .../java/com/salesforce/apollo/fireflies/ChurnTest.java | 8 +++----- .../java/com/salesforce/apollo/fireflies/SwarmTest.java | 8 +++----- .../java/com/salesforce/apollo/model/DomainTest.java | 9 +++++---- .../java/com/salesforce/apollo/model/FireFliesTest.java | 9 +++++---- pom.xml | 2 +- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/choam/src/test/java/com/salesforce/apollo/choam/DynamicTest.java b/choam/src/test/java/com/salesforce/apollo/choam/DynamicTest.java index ebd508af6..fe29a7e45 100644 --- a/choam/src/test/java/com/salesforce/apollo/choam/DynamicTest.java +++ b/choam/src/test/java/com/salesforce/apollo/choam/DynamicTest.java @@ -3,7 +3,6 @@ import com.salesforce.apollo.archipelago.LocalServer; import com.salesforce.apollo.archipelago.Router; import com.salesforce.apollo.archipelago.ServerConnectionCache; -import com.salesforce.apollo.archipelago.UnsafeExecutors; import com.salesforce.apollo.choam.support.ExponentialBackoffPolicy; import com.salesforce.apollo.context.Context; import com.salesforce.apollo.context.DynamicContext; @@ -64,10 +63,9 @@ public void setUp() throws Exception { .toList(); final var prefix = UUID.randomUUID().toString(); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); routers = members.stream() .collect(Collectors.toMap(m -> m, m -> new LocalServer(prefix, m).router( - ServerConnectionCache.newBuilder().setTarget(cardinality * 2), executor))); + ServerConnectionCache.newBuilder().setTarget(cardinality * 2)))); var template = Parameters.newBuilder() .setGenerateGenesis(true) diff --git a/choam/src/test/java/com/salesforce/apollo/choam/TestCHOAM.java b/choam/src/test/java/com/salesforce/apollo/choam/TestCHOAM.java index 66d941748..391706bf2 100644 --- a/choam/src/test/java/com/salesforce/apollo/choam/TestCHOAM.java +++ b/choam/src/test/java/com/salesforce/apollo/choam/TestCHOAM.java @@ -8,7 +8,10 @@ import com.codahale.metrics.ConsoleReporter; import com.codahale.metrics.MetricRegistry; -import com.salesforce.apollo.archipelago.*; +import com.salesforce.apollo.archipelago.LocalServer; +import com.salesforce.apollo.archipelago.Router; +import com.salesforce.apollo.archipelago.ServerConnectionCache; +import com.salesforce.apollo.archipelago.ServerConnectionCacheMetricsImpl; import com.salesforce.apollo.choam.CHOAM.TransactionExecutor; import com.salesforce.apollo.choam.Parameters.ProducerParameters; import com.salesforce.apollo.choam.Parameters.RuntimeParameters; @@ -121,12 +124,11 @@ public void before() throws Exception { .toList(); var context = new StaticContext<>(origin, 0.2, members, 3); final var prefix = UUID.randomUUID().toString(); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); routers = members.stream() .collect(Collectors.toMap(m -> m.getId(), m -> new LocalServer(prefix, m).router( ServerConnectionCache.newBuilder() .setMetrics(new ServerConnectionCacheMetricsImpl(registry)) - .setTarget(CARDINALITY), executor))); + .setTarget(CARDINALITY)))); choams = members.stream().collect(Collectors.toMap(m -> m.getId(), m -> { var recording = new AtomicInteger(); blocks.put(m.getId(), recording); diff --git a/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java b/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java index 64b249b3a..9825e45f6 100644 --- a/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java +++ b/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java @@ -273,7 +273,6 @@ private void initialize() { AtomicBoolean frist = new AtomicBoolean(true); final var prefix = UUID.randomUUID().toString(); final var gatewayPrefix = UUID.randomUUID().toString(); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); views = members.values().stream().map(node -> { DynamicContext context = ctxBuilder.build(); FireflyMetricsImpl metrics = new FireflyMetricsImpl(context.getId(), @@ -283,15 +282,14 @@ private void initialize() { .setMetrics( new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) ? node0Registry - : registry)), - executor); + : registry))); var gateway = new LocalServer(gatewayPrefix, node).router(ServerConnectionCache.newBuilder() .setTarget(200) .setMetrics( new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) - ? node0Registry : registry)), - executor); + ? node0Registry + : registry))); comms.start(); communications.add(comms); diff --git a/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java b/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java index 51a88234d..0e4f93dc6 100644 --- a/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java +++ b/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java @@ -230,21 +230,19 @@ private void initialize() { DynamicContext context = ctxBuilder.build(); FireflyMetricsImpl metrics = new FireflyMetricsImpl(context.getId(), frist.getAndSet(false) ? node0Registry : registry); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); var comms = new LocalServer(prefix, node).router(ServerConnectionCache.newBuilder() .setTarget(200) .setMetrics( new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) ? node0Registry - : registry)), - executor); + : registry))); var gateway = new LocalServer(gatewayPrefix, node).router(ServerConnectionCache.newBuilder() .setTarget(200) .setMetrics( new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) - ? node0Registry : registry)), - executor); + ? node0Registry + : registry))); comms.start(); communications.add(comms); diff --git a/model/src/test/java/com/salesforce/apollo/model/DomainTest.java b/model/src/test/java/com/salesforce/apollo/model/DomainTest.java index 3cb29dd42..dd5f0503f 100644 --- a/model/src/test/java/com/salesforce/apollo/model/DomainTest.java +++ b/model/src/test/java/com/salesforce/apollo/model/DomainTest.java @@ -6,7 +6,10 @@ */ package com.salesforce.apollo.model; -import com.salesforce.apollo.archipelago.*; +import com.salesforce.apollo.archipelago.EndpointProvider; +import com.salesforce.apollo.archipelago.LocalServer; +import com.salesforce.apollo.archipelago.Router; +import com.salesforce.apollo.archipelago.ServerConnectionCache; import com.salesforce.apollo.choam.Parameters; import com.salesforce.apollo.choam.Parameters.Builder; import com.salesforce.apollo.choam.Parameters.RuntimeParameters; @@ -235,11 +238,9 @@ public void before() throws Exception { var sealed = FoundationSeal.newBuilder().build(); final var group = DigestAlgorithm.DEFAULT.getOrigin(); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); identities.forEach((d, id) -> { final var member = new ControlledIdentifierMember(id); - var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30), - executor); + var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30)); routers.add(localRouter); var dbUrl = String.format("jdbc:h2:mem:sql-%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID()); var pdParams = new ProcessDomain.ProcessDomainParameters(dbUrl, Duration.ofMinutes(1), diff --git a/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java b/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java index c6a48aa41..beb936b33 100644 --- a/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java +++ b/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java @@ -6,7 +6,10 @@ */ package com.salesforce.apollo.model; -import com.salesforce.apollo.archipelago.*; +import com.salesforce.apollo.archipelago.EndpointProvider; +import com.salesforce.apollo.archipelago.LocalServer; +import com.salesforce.apollo.archipelago.Router; +import com.salesforce.apollo.archipelago.ServerConnectionCache; import com.salesforce.apollo.choam.Parameters; import com.salesforce.apollo.choam.Parameters.Builder; import com.salesforce.apollo.choam.Parameters.RuntimeParameters; @@ -78,12 +81,10 @@ public void before() throws Exception { Digest group = DigestAlgorithm.DEFAULT.getOrigin(); var sealed = FoundationSeal.newBuilder().build(); - var executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); identities.forEach((digest, id) -> { var context = new DynamicContextImpl<>(DigestAlgorithm.DEFAULT.getLast(), CARDINALITY, 0.2, 3); final var member = new ControlledIdentifierMember(id); - var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30), - executor); + var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30)); var dbUrl = String.format("jdbc:h2:mem:sql-%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID()); var pdParams = new ProcessDomain.ProcessDomainParameters(dbUrl, Duration.ofSeconds(5), "jdbc:h2:mem:%s-state".formatted(digest), diff --git a/pom.xml b/pom.xml index 9e386ff13..557face93 100644 --- a/pom.xml +++ b/pom.xml @@ -784,7 +784,7 @@ ${forks} false - -Xmx10G -Xms100M + -Xmx10G -Xms4G -Djdk.tracePinnedThreads=full