diff --git a/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/GrpcConnector.java b/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/GrpcConnector.java index ae83227f23..21dc567a27 100644 --- a/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/GrpcConnector.java +++ b/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/GrpcConnector.java @@ -32,7 +32,7 @@ public class GrpcConnector, K extends AbstractBlocking /** * The blocking service stub for making blocking GRPC calls. */ - private final K blockingStub; + private final Function blockingStubFunction; /** * The GRPC managed channel for managing the underlying GRPC connection. @@ -59,6 +59,8 @@ public class GrpcConnector, K extends AbstractBlocking */ private final Consumer streamObserver; + private final FlagdOptions options; + /** * Indicates whether the connector is currently connected to the GRPC service. */ @@ -85,11 +87,12 @@ public GrpcConnector( this.channel = channel; this.serviceStub = stub.apply(channel).withWaitForReady(); - this.blockingStub = blockingStub.apply(channel).withWaitForReady(); + this.blockingStubFunction = blockingStub; this.deadline = options.getDeadline(); this.streamDeadlineMs = options.getStreamDeadlineMs(); this.onConnectionEvent = onConnectionEvent; this.streamObserver = eventStreamObserver; + this.options = options; } /** @@ -126,7 +129,7 @@ public void initialize() throws Exception { * @return the blocking service stub */ public K getResolver() { - return blockingStub; + return blockingStubFunction.apply(channel).withWaitForReady().withDeadlineAfter(options.getDeadline(), TimeUnit.MILLISECONDS); } /** diff --git a/providers/flagd/test-harness b/providers/flagd/test-harness index 34a0c31765..30f7c8b2c8 160000 --- a/providers/flagd/test-harness +++ b/providers/flagd/test-harness @@ -1 +1 @@ -Subproject commit 34a0c31765041fc070a89eb4241859c5453a26a4 +Subproject commit 30f7c8b2c8e507feb06bba183d118414774d4562