From 03c276f78e1a3edc41359e2881d3494d6ff51931 Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Fri, 22 Nov 2024 12:52:50 -0700 Subject: [PATCH] fix: resetting after debugging Signed-off-by: Matt Peterson --- server/docker/docker-compose.yml | 1 + server/docker/logging.properties | 5 +++-- server/docker/update-env.sh | 5 +++-- .../server/mediator/NoOpLiveStreamMediator.java | 5 ----- .../server/mediator/SubscriptionHandler.java | 2 -- .../server/mediator/SubscriptionHandlerBase.java | 5 ----- server/src/main/resources/app.properties | 1 - settings.gradle.kts | 16 +++++++--------- simulator/src/main/resources/app.properties | 11 +++++------ 9 files changed, 19 insertions(+), 32 deletions(-) diff --git a/server/docker/docker-compose.yml b/server/docker/docker-compose.yml index d182b4e3b..f3a945597 100644 --- a/server/docker/docker-compose.yml +++ b/server/docker/docker-compose.yml @@ -8,6 +8,7 @@ services: - "8080:8080" - "5005:5005" - "9999:9999" + - "8849:8849" cadvisor: image: "gcr.io/cadvisor/cadvisor:v0.47.0" diff --git a/server/docker/logging.properties b/server/docker/logging.properties index 34334b3c7..b8ebfe840 100644 --- a/server/docker/logging.properties +++ b/server/docker/logging.properties @@ -21,14 +21,15 @@ io.helidon.common.level=INFO #com.hedera.block.level=FINE #com.hedera.block.server.level=FINE -# Configure specific loggers +# Configure specific Block Node loggers #com.hedera.block.server.producer.ProducerBlockItemObserver.level=FINE #com.hedera.block.server.mediator.LiveStreamMediatorImpl.level=FINE #com.hedera.block.server.persistence.storage.write.BlockAsDirWriter.level=FINE #com.hedera.block.server.consumer.ConsumerStreamResponseObserver.level=FINE +#com.hedera.block.server.pbj.PbjBlockStreamServiceProxy.level=FINE +# Helidon PBJ Plugin loggers #com.hedera.pbj.grpc.helidon.PbjProtocolHandler.level=FINE -com.hedera.pbj.grpc.helidon.level=FINE # Console handler configuration handlers = java.util.logging.ConsoleHandler diff --git a/server/docker/update-env.sh b/server/docker/update-env.sh index 9594fcf8d..29a593980 100755 --- a/server/docker/update-env.sh +++ b/server/docker/update-env.sh @@ -21,8 +21,9 @@ echo "REGISTRY_PREFIX=" >> .env echo "BLOCKNODE_STORAGE_ROOT_PATH=/app/storage" >> .env if [ true = "$is_debug" ]; then - # wait for debugger to attach - echo "SERVER_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005'" >> .env + # The server will wait for the debugger to attach on port 5005 + # JProfiler can attach on port 8849 + echo "SERVER_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005' -agentpath:/path/to/libjprofilerti.so=port=8849 " >> .env fi if [ true = "$is_smoke_test" ]; then diff --git a/server/src/main/java/com/hedera/block/server/mediator/NoOpLiveStreamMediator.java b/server/src/main/java/com/hedera/block/server/mediator/NoOpLiveStreamMediator.java index 5473ca5a1..5a2ea6573 100644 --- a/server/src/main/java/com/hedera/block/server/mediator/NoOpLiveStreamMediator.java +++ b/server/src/main/java/com/hedera/block/server/mediator/NoOpLiveStreamMediator.java @@ -86,9 +86,4 @@ public void unsubscribeAllExpired() {} */ @Override public void notifyUnrecoverableError() {} - - @Override - public int subscriberCount() { - return 0; - } } diff --git a/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandler.java b/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandler.java index 2860ae43a..391b1a909 100644 --- a/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandler.java +++ b/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandler.java @@ -52,6 +52,4 @@ public interface SubscriptionHandler { /** Unsubscribes all the expired handlers from the stream of events. */ void unsubscribeAllExpired(); - - int subscriberCount(); } diff --git a/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandlerBase.java b/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandlerBase.java index 8bcc827b2..6cf2330b0 100644 --- a/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandlerBase.java +++ b/server/src/main/java/com/hedera/block/server/mediator/SubscriptionHandlerBase.java @@ -137,9 +137,4 @@ public void unsubscribeAllExpired() { .filter(BlockNodeEventHandler::isTimeoutExpired) .forEach(this::unsubscribe); } - - @Override - public int subscriberCount() { - return subscribers.size(); - } } diff --git a/server/src/main/resources/app.properties b/server/src/main/resources/app.properties index fc9c160ca..7dab79f79 100644 --- a/server/src/main/resources/app.properties +++ b/server/src/main/resources/app.properties @@ -8,7 +8,6 @@ prometheus.endpointPortNumber=9999 # Timeout for consumers to wait for block item before timing out. # Default is 1500 milliseconds. #consumer.timeoutThresholdMillis=1500 -consumer.timeoutThresholdMillis=100000 #producer.type=NOOP #mediator.type=NOOP diff --git a/settings.gradle.kts b/settings.gradle.kts index 318e6801a..39d8cc392 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,8 +18,6 @@ plugins { id("com.gradle.enterprise").version("3.15.1") } -includeBuild("/Users/mattpeterson/repos/pbj/pbj-core") - // Include the subprojects include(":common") include(":suites") @@ -49,8 +47,9 @@ dependencyResolutionManagement { // Define a constant for protobuf version. val protobufVersion = "4.28.2" - val helidonVersion = "4.1.1" + val grpcIoVersion = "1.65.1" + var pbjVersion = "0.9.10" // Compile time dependencies version("io.helidon.webserver.http2", helidonVersion) @@ -71,22 +70,21 @@ dependencyResolutionManagement { version("info.picocli", "4.7.6") // gRPC dependencies for the stream subproject - version("io.grpc", "1.65.1") - version("io.grpc.protobuf", "1.65.1") - version("io.grpc.stub", "1.65.1") + version("io.grpc", grpcIoVersion) + version("io.grpc.protobuf", grpcIoVersion) + version("io.grpc.stub", grpcIoVersion) // netty dependency for the simulator subproject - version("io.grpc.netty.shaded", "1.65.1") + version("io.grpc.netty.shaded", grpcIoVersion) // Reference from the protobuf plugin version("google.proto", protobufVersion) - version("grpc.protobuf.grpc", "1.65.1") + version("grpc.protobuf.grpc", grpcIoVersion) // Google protobuf dependencies version("com.google.protobuf", protobufVersion) version("com.google.protobuf.util", protobufVersion) - var pbjVersion = "0.9.10-SNAPSHOT" // PBJ dependencies plugin("pbj", "com.hedera.pbj.pbj-compiler").version(pbjVersion) diff --git a/simulator/src/main/resources/app.properties b/simulator/src/main/resources/app.properties index e3829977f..9d61c220f 100644 --- a/simulator/src/main/resources/app.properties +++ b/simulator/src/main/resources/app.properties @@ -11,16 +11,15 @@ prometheus.endpointEnabled=false # BlockAsFileLargeDataSets config # ---------------------------------------------- #generator.folderRootPath=/Users/user/Downloads/block-0.0.3-perf -generator.folderRootPath=/Users/mattpeterson/Downloads/BN_Test_Data/block-0.0.3 -generator.managerImplementation=BlockAsFileLargeDataSets +#generator.managerImplementation=BlockAsFileLargeDataSets # Optional range configuration -generator.startBlockNumber=200 -generator.endBlockNumber=3000 +#generator.startBlockNumber=1 +#generator.endBlockNumber=2000 #blockStream.maxBlockItemsToStream=100_000_000 -blockStream.streamingMode=MILLIS_PER_BLOCK -blockStream.millisecondsPerBlock=200 +#blockStream.streamingMode=MILLIS_PER_BLOCK +#blockStream.millisecondsPerBlock=500 #blockStream.blockItemsBatchSize=1_000 #blockStream.delayBetweenBlockItems=3_000_000