diff --git a/design/architecture/system-architecture-grpc.md b/design/architecture/system-architecture-grpc.md index 0b5e9b809e..89368d8b1d 100644 --- a/design/architecture/system-architecture-grpc.md +++ b/design/architecture/system-architecture-grpc.md @@ -166,6 +166,10 @@ Gameplay command streams from clients into Game Session are intentionally **diff - Accepted command execution as durably tracked and idempotent, with automatic replay only for explicitly safe command classes. - Internal event/notification streams as at‑least‑once with required idempotency keys. +## Keepalive Requirements + +Shared gRPC clients with keepalive enabled use a 30-second keepalive interval, a 5-second timeout, and permit pings while no calls are active. Internal gRPC servers use the same 30-second interval and 5-second timeout, permit pings without active calls, and accept client keepalives no more frequently than every 30 seconds. Every service configuration states all four server values explicitly, including `spring.grpc.server.keep-alive.permit-time: 30s`; the Spring gRPC 1.0.3 default permit interval is longer and is incompatible with the shared client interval. Manually composed clients and servers use the shared keepalive policy so they follow the same transport contract. Explicit server builder customizers may override the defaults when a supported caller requires different values, provided the paired client interval and idle-ping behavior remain compatible. + ## TLS Requirements All internal gRPC calls use **mutual TLS**. FireMUD services now express the server-side TLS contract with Spring gRPC SSL bundles: diff --git a/design/developer-workflows/pr-lifecycle.md b/design/developer-workflows/pr-lifecycle.md index fc04859888..db27579ff9 100644 --- a/design/developer-workflows/pr-lifecycle.md +++ b/design/developer-workflows/pr-lifecycle.md @@ -13,8 +13,8 @@ FireMUD owns the project authority and safety requirements below. Follow the act - Verify the exact committed candidate, live PR head/base, effective parent, provider-observed diff base, ancestry, and unique patch before relying on review evidence. Refresh after identity or topology changes and distinguish historical coverage from current-code proof. Reconciliation must preserve the owned patch, evidence, findings, and actual configured controls. Never describe an expected parent as the provider’s actual diff base when they differ. - Preserve actual human stops and allocations independently of candidate preparation and merge readiness. Reaching a configured discovery limit or stopping a channel does not erase findings, grant coverage, or establish readiness. Do not reopen, replace, reset, or approximate controls without the required authority. Deliberate queue removal requires explicit User authorization and an audited reason; merging or closing a PR does not grant it. - Adjudicate findings as accepted, routed, or rejected with a concrete outcome and evidence. Accepted findings remain source-owned correction obligations until verified fixed. Routed observations identify another owner without claiming that owner’s acceptance or fix. Target owners independently disposition incoming routes and verify resolutions; retargeting preserves the open obligation and prior ownership, including honest unassigned work. Open outgoing routes do not hold the source’s merge readiness. Preserve source linkage and original evidence when correcting a disposition; newly accepted findings still require fixes. -- Summary-only and outside-diff findings require verification and disposition as well as inline findings. Historical accepted-fixed evidence does not replace current verification. Resolve a thread only after its exact finding is fixed at the current published head; do not conceal unresolved work through thread resolution or record edits. -- Routine bot findings do not need public replies or reflexive `@coderabbit` exchanges. Record the assessment, decision, and any fix and verification proof in FireController; resolve verified-fixed threads without extra chat under the current-published-head rule above. Reply only when genuine clarification or reconsideration is needed, or to provide necessary context for human reviewers, and only within applicable communication authorization. +- Summary-only and outside-diff findings require verification and disposition as well as inline findings. Historical accepted-fixed evidence does not replace current verification. Resolve a thread after verifying at the current published head that its exact finding is fixed, or that it was rejected or withdrawn and no actionable work remains. Record the concrete reason and current-head evidence in FireController and preserve the original finding and disposition. Record fix evidence only for a verified correction. Do not conceal unresolved work through thread resolution or record edits. +- Routine bot findings do not need public replies or reflexive `@coderabbit` exchanges. Record the assessment, decision, and any fix and verification proof in FireController; resolve eligible threads without extra chat under the current-published-head rule above. Reply only when genuine clarification or reconsideration is needed, or to provide necessary context for human reviewers, and only within applicable communication authorization. - Keep private captures, review history, findings, and uncertain publication intents intact. Recover only through the installed release’s supported guarded operations within existing authority. Recording, recovery, imports, or publication alone grant no provider credit, fix proof, CI result, or merge authority. Do not blind-repost an uncertain checkpoint, invent attribution, or infer delivery failure from public absence. Unsupported or ambiguous recovery remains a reported hold for FireController Worker. - Follow the configured admission, provider-exclusion, quota, and cooldown controls; do not request against an active or rate-limited target or enable paid capacity. Use included quota only. Supported operations and recorded allowances do not themselves grant authority or clear unrelated holds. - For CI observation using a shared GitHub credential budget, coordinate one observer across relevant workers and runs. Prefer the supported native batched CI wait and existing inbox notices for followed PR merges, closures, and review completions; other workers consume those results and continue independent work. Add review-activity or known-operation waits when a relevant review hold or retained operation needs observation. Do not fan out simultaneous per-run watchers or duplicate an active observer. Use narrow run-list or run-view reads at least 60 seconds apart only when a supported wait cannot supply the required evidence, and check status at meaningful readiness transitions. Honor evidenced reset/retry-after times; report a hold when no time is available. diff --git a/dev-tools/deploy/preflight.py b/dev-tools/deploy/preflight.py index ba347469a3..baa4da69bf 100644 --- a/dev-tools/deploy/preflight.py +++ b/dev-tools/deploy/preflight.py @@ -1715,12 +1715,13 @@ def validate_recovery_freshness( "fail", f"Recovery compatibility baseline {disposition} freshness must advance the existing timestamp: {class_name}", ) - elif disposition in {"rebound", "verified_not_restored"}: - if field != previous_field or value_timestamp != previous_value: - return ( - "fail", - f"Recovery compatibility baseline {disposition} freshness must preserve the existing field/value: {class_name}", - ) + elif disposition in {"rebound", "verified_not_restored"} and ( + field != previous_field or value_timestamp != previous_value + ): + return ( + "fail", + f"Recovery compatibility baseline {disposition} freshness must preserve the existing field/value: {class_name}", + ) return ("pass", "") diff --git a/services/account-service/src/main/resources/application.yml b/services/account-service/src/main/resources/application.yml index 8cb3e8e012..f7437be265 100644 --- a/services/account-service/src/main/resources/application.yml +++ b/services/account-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/automation-scripting-service/src/main/resources/application.yml b/services/automation-scripting-service/src/main/resources/application.yml index f52fc06daf..12b700b0da 100644 --- a/services/automation-scripting-service/src/main/resources/application.yml +++ b/services/automation-scripting-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactory.java b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactory.java index 3ef97f15d7..abb75a7350 100644 --- a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactory.java +++ b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactory.java @@ -58,6 +58,7 @@ protected void configureServices( @Override protected void configure(NettyServerBuilder builder, List services) { + GrpcKeepAlivePolicy.configureServer(builder); super.configure(builder, services); // Customizers cannot leave an alternate mutable lookup or widen the finite ceiling. builder.fallbackHandlerRegistry(CLOSED_FALLBACK); diff --git a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcChannelFactory.java b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcChannelFactory.java index f6e31020e2..cbdd32ecc6 100644 --- a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcChannelFactory.java +++ b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcChannelFactory.java @@ -6,7 +6,6 @@ import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; import java.io.File; import java.io.InputStream; -import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLException; /** Builds outbound gRPC channels with FireMUD's standard TLS and keepalive behavior. */ @@ -89,9 +88,6 @@ private void configureKeepAlive(ManagedChannelBuilder builder, boolean keepAl if (!keepAlive) { return; } - builder - .keepAliveTime(30, TimeUnit.SECONDS) - .keepAliveTimeout(5, TimeUnit.SECONDS) - .keepAliveWithoutCalls(true); + GrpcKeepAlivePolicy.configureClient(builder); } } diff --git a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicy.java b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicy.java new file mode 100644 index 0000000000..514941a143 --- /dev/null +++ b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicy.java @@ -0,0 +1,31 @@ +package net.firedevops.firemud.common.grpc; + +import io.grpc.ManagedChannelBuilder; +import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; +import java.util.concurrent.TimeUnit; + +/** Shared client and server gRPC keepalive settings. */ +public final class GrpcKeepAlivePolicy { + private static final long KEEP_ALIVE_INTERVAL_SECONDS = 30; + private static final long KEEP_ALIVE_TIMEOUT_SECONDS = 5; + private static final long SERVER_MINIMUM_PERMIT_INTERVAL_SECONDS = 30; + + private GrpcKeepAlivePolicy() {} + + /** Applies the shared ping interval, timeout, and idle-ping policy to a client builder. */ + public static void configureClient(ManagedChannelBuilder builder) { + builder + .keepAliveTime(KEEP_ALIVE_INTERVAL_SECONDS, TimeUnit.SECONDS) + .keepAliveTimeout(KEEP_ALIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS) + .keepAliveWithoutCalls(true); + } + + /** Applies server ping settings and admits the shared client's idle-ping interval. */ + public static void configureServer(NettyServerBuilder builder) { + builder + .keepAliveTime(KEEP_ALIVE_INTERVAL_SECONDS, TimeUnit.SECONDS) + .keepAliveTimeout(KEEP_ALIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS) + .permitKeepAliveWithoutCalls(true) + .permitKeepAliveTime(SERVER_MINIMUM_PERMIT_INTERVAL_SECONDS, TimeUnit.SECONDS); + } +} diff --git a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactoryTest.java b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactoryTest.java index fcb12fc070..9fd3341954 100644 --- a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactoryTest.java +++ b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/BoundedGrpcServerFactoryTest.java @@ -2,6 +2,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.spy; import io.grpc.CallOptions; import io.grpc.HandlerRegistry; @@ -14,8 +16,10 @@ import io.grpc.TlsServerCredentials; import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; +import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.util.List; import java.util.concurrent.TimeUnit; @@ -24,10 +28,43 @@ import net.firedevops.firemud.test.LoopbackMtlsTestPki.IdentitySpec; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import org.mockito.InOrder; class BoundedGrpcServerFactoryTest { private static final int ORDINARY = GrpcRequestBytePolicy.ORDINARY_MAXIMUM_BYTES; + @Test + void canonicalServerKeepAliveDefaultsPrecedeSupportedCustomizers() { + var builder = spy(NettyServerBuilder.forAddress(new InetSocketAddress("127.0.0.1", 0))); + var factory = + new BoundedGrpcServerFactory( + "127.0.0.1:0", + List.of( + customizer -> + customizer + .keepAliveTime(45, TimeUnit.SECONDS) + .keepAliveTimeout(7, TimeUnit.SECONDS) + .permitKeepAliveWithoutCalls(false) + .permitKeepAliveTime(60, TimeUnit.SECONDS)), + null, + null, + TlsServerCredentials.ClientAuth.NONE, + new GrpcRequestBytePolicy(List.of()), + ORDINARY); + + factory.configure(builder, List.of()); + + InOrder calls = inOrder(builder); + calls.verify(builder).keepAliveTime(30, TimeUnit.SECONDS); + calls.verify(builder).keepAliveTimeout(5, TimeUnit.SECONDS); + calls.verify(builder).permitKeepAliveWithoutCalls(true); + calls.verify(builder).permitKeepAliveTime(30, TimeUnit.SECONDS); + calls.verify(builder).keepAliveTime(45, TimeUnit.SECONDS); + calls.verify(builder).keepAliveTimeout(7, TimeUnit.SECONDS); + calls.verify(builder).permitKeepAliveWithoutCalls(false); + calls.verify(builder).permitKeepAliveTime(60, TimeUnit.SECONDS); + } + @Test void rejectsDuplicateUnknownAndNonidenticalDescriptorConfiguration() { var method = method("test.Owner/Read", new AtomicInteger()); diff --git a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/CommonGrpcRequestBoundsAutoConfigurationTest.java b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/CommonGrpcRequestBoundsAutoConfigurationTest.java index 4fbf6e76b9..63d62a3a46 100644 --- a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/CommonGrpcRequestBoundsAutoConfigurationTest.java +++ b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/CommonGrpcRequestBoundsAutoConfigurationTest.java @@ -21,7 +21,9 @@ import io.grpc.protobuf.ProtoUtils; import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; +import java.time.Duration; import java.util.List; +import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -36,6 +38,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.context.properties.bind.Binder; +import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; import org.springframework.boot.grpc.server.autoconfigure.GrpcServerAutoConfiguration; import org.springframework.boot.grpc.server.autoconfigure.GrpcServerFactoryAutoConfiguration; import org.springframework.boot.grpc.server.autoconfigure.GrpcServerFactoryCustomizer; @@ -74,6 +78,18 @@ class CommonGrpcRequestBoundsAutoConfigurationTest { .withPropertyValues("spring.grpc.server.port=0", "spring.grpc.server.ssl.enabled=false") .withUserConfiguration(DiscoveredServiceConfiguration.class); + @Test + void explicitServerPermitIntervalBindsFromConfiguration() { + var properties = + new Binder( + new MapConfigurationPropertySource( + Map.of("spring.grpc.server.keep-alive.permit-time", "30s"))) + .bind("spring.grpc.server", GrpcServerProperties.class) + .get(); + + assertThat(properties.getKeepAlive().getPermitTime()).isEqualTo(Duration.ofSeconds(30)); + } + @Test void productionAutoConfigurationDiscoversRegistersAndCallsRealServiceWithOrderedInterceptors() { runner.run( diff --git a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicyTest.java b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicyTest.java new file mode 100644 index 0000000000..907f8a5b6f --- /dev/null +++ b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/grpc/GrpcKeepAlivePolicyTest.java @@ -0,0 +1,38 @@ +package net.firedevops.firemud.common.grpc; + +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.spy; + +import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; +import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; +import java.net.InetSocketAddress; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.mockito.InOrder; + +class GrpcKeepAlivePolicyTest { + @Test + void configuresClientIntervalTimeoutAndIdlePings() { + var builder = spy(NettyChannelBuilder.forAddress("127.0.0.1", 6565)); + + GrpcKeepAlivePolicy.configureClient(builder); + + InOrder calls = inOrder(builder); + calls.verify(builder).keepAliveTime(30, TimeUnit.SECONDS); + calls.verify(builder).keepAliveTimeout(5, TimeUnit.SECONDS); + calls.verify(builder).keepAliveWithoutCalls(true); + } + + @Test + void configuresServerIntervalTimeoutAndAllowedIdlePings() { + var builder = spy(NettyServerBuilder.forAddress(new InetSocketAddress("127.0.0.1", 6565))); + + GrpcKeepAlivePolicy.configureServer(builder); + + InOrder calls = inOrder(builder); + calls.verify(builder).keepAliveTime(30, TimeUnit.SECONDS); + calls.verify(builder).keepAliveTimeout(5, TimeUnit.SECONDS); + calls.verify(builder).permitKeepAliveWithoutCalls(true); + calls.verify(builder).permitKeepAliveTime(30, TimeUnit.SECONDS); + } +} diff --git a/services/entity-management-service/src/main/resources/application.yml b/services/entity-management-service/src/main/resources/application.yml index dc3d49415d..497e6fff6e 100644 --- a/services/entity-management-service/src/main/resources/application.yml +++ b/services/entity-management-service/src/main/resources/application.yml @@ -28,6 +28,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/game-design-service/src/main/resources/application.yml b/services/game-design-service/src/main/resources/application.yml index 7272e16f83..d3f9319701 100644 --- a/services/game-design-service/src/main/resources/application.yml +++ b/services/game-design-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/game-logic-service/src/main/resources/application.yml b/services/game-logic-service/src/main/resources/application.yml index 972d39e002..2c3014e57c 100644 --- a/services/game-logic-service/src/main/resources/application.yml +++ b/services/game-logic-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/game-session-service/src/main/resources/application.yml b/services/game-session-service/src/main/resources/application.yml index bd9cd448c0..6cf1a4b06c 100644 --- a/services/game-session-service/src/main/resources/application.yml +++ b/services/game-session-service/src/main/resources/application.yml @@ -28,6 +28,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/logging-admin-service/src/main/resources/application.yml b/services/logging-admin-service/src/main/resources/application.yml index 95df69e181..dbf4656c8f 100644 --- a/services/logging-admin-service/src/main/resources/application.yml +++ b/services/logging-admin-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/social-groups-service/src/main/resources/application.yml b/services/social-groups-service/src/main/resources/application.yml index a3baf33c2c..de8ec720f9 100644 --- a/services/social-groups-service/src/main/resources/application.yml +++ b/services/social-groups-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/spring-cloud-gateway/src/main/resources/application.yml b/services/spring-cloud-gateway/src/main/resources/application.yml index 42aaef600d..4fe879bb01 100644 --- a/services/spring-cloud-gateway/src/main/resources/application.yml +++ b/services/spring-cloud-gateway/src/main/resources/application.yml @@ -59,6 +59,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/tcp-proxy-service/src/main/resources/application.yml b/services/tcp-proxy-service/src/main/resources/application.yml index 3cd40f68ef..6d2b41d655 100644 --- a/services/tcp-proxy-service/src/main/resources/application.yml +++ b/services/tcp-proxy-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/world-management-service/src/main/resources/application.yml b/services/world-management-service/src/main/resources/application.yml index db840be505..e6f75b1f26 100644 --- a/services/world-management-service/src/main/resources/application.yml +++ b/services/world-management-service/src/main/resources/application.yml @@ -26,6 +26,7 @@ spring: time: 30s timeout: 5s permit-without-calls: true + permit-time: 30s ssl: enabled: ${GRPC_SERVER_TLS_ENABLED:true} bundle: firemud-grpc diff --git a/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionPreparationOwnerCompositionCrossServiceTest.java b/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionPreparationOwnerCompositionCrossServiceTest.java index e8c044e834..1723ad85c1 100644 --- a/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionPreparationOwnerCompositionCrossServiceTest.java +++ b/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionPreparationOwnerCompositionCrossServiceTest.java @@ -122,6 +122,7 @@ import net.firedevops.firemud.common.gamesession.HistoricalOriginalStartSessionOwnerEvidenceReadClient; import net.firedevops.firemud.common.grpc.BoundedGrpcServerFactory; import net.firedevops.firemud.common.grpc.GrpcChannelFactory; +import net.firedevops.firemud.common.grpc.GrpcKeepAlivePolicy; import net.firedevops.firemud.common.grpc.GrpcPeerIdentity; import net.firedevops.firemud.common.grpc.GrpcPeerIdentityInterceptor; import net.firedevops.firemud.common.grpc.GrpcRequestBytePolicy; @@ -4713,6 +4714,7 @@ private static Server buildServer( .trustManager(pki.ca().toFile()) .clientAuth(ClientAuth.REQUIRE) .build()); + GrpcKeepAlivePolicy.configureServer(builder); if (deferredServices != null) builder.fallbackHandlerRegistry(deferredServices); if (Arrays.stream(receivers) .anyMatch(AccountInitialAdmissionSettlementReadGrpcService.class::isInstance)) { diff --git a/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldPublishedAdmissionSourceComposition.java b/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldPublishedAdmissionSourceComposition.java index 6d66e9b778..ed12365736 100644 --- a/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldPublishedAdmissionSourceComposition.java +++ b/services/world-management-service/src/test/java/crossservice/net/firedevops/firemud/worldmanagement/tenant/WorldPublishedAdmissionSourceComposition.java @@ -24,6 +24,7 @@ import net.firedevops.firemud.common.gamesession.CanonicalGameplayAdmissionDecisionReadGrpcCodec.RetainedTargetSelector; import net.firedevops.firemud.common.grpc.CommonGrpcClientProperties; import net.firedevops.firemud.common.grpc.GrpcChannelFactory; +import net.firedevops.firemud.common.grpc.GrpcKeepAlivePolicy; import net.firedevops.firemud.common.grpc.GrpcPeerIdentity; import net.firedevops.firemud.common.grpc.GrpcPeerIdentityInterceptor; import net.firedevops.firemud.common.publication.PublishedRealmEntryPolicyEvidence; @@ -253,7 +254,9 @@ private static String peer(String namespace, String service) { private static Server server( LoopbackMtlsTestPki.Pki pki, String identity, BindableService receiver) throws Exception { - return NettyServerBuilder.forAddress(new InetSocketAddress("127.0.0.1", 0)) + var builder = NettyServerBuilder.forAddress(new InetSocketAddress("127.0.0.1", 0)); + GrpcKeepAlivePolicy.configureServer(builder); + return builder .sslContext( GrpcSslContexts.configure( io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder.forServer(