-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: gRPC stream connection deadline #999
feat: gRPC stream connection deadline #999
Conversation
Signed-off-by: Guido Breitenhuber <[email protected]>
@@ -55,6 +56,7 @@ public GrpcStreamConnector(final FlagdOptions options) { | |||
serviceStub = FlagSyncServiceGrpc.newStub(channel); | |||
serviceBlockingStub = FlagSyncServiceGrpc.newBlockingStub(channel); | |||
deadline = options.getDeadline(); | |||
streamDeadlineMs = options.getStreamDeadlineMs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion] Cant we just use the options within this class, and pass it further down the call chain? - adding a new field and parameters might be tedious over time
@@ -64,6 +65,7 @@ public GrpcConnector(final FlagdOptions options, final Cache cache, final Suppli | |||
this.startEventStreamRetryBackoff = options.getRetryBackoffMs(); | |||
this.eventStreamRetryBackoff = options.getRetryBackoffMs(); | |||
this.deadline = options.getDeadline(); | |||
this.streamDeadlineMs = options.getStreamDeadlineMs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion] using the options object instead of separate fields would reduce this over head of adding a new field all the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can go either way on this one. In fact it might be a good thing to do in a pure refactor/cleanup PR. There's also some naming that we can probably improve with the provider.
Signed-off-by: Todd Baert <[email protected]>
providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdOptions.java
Show resolved
Hide resolved
…s/flagd/FlagdOptions.java Signed-off-by: Todd Baert <[email protected]>
This PR
adds deadlines to GRPC stream connections in the flagd provider.
In GRPC setups, where L7 proxies route traffic between the provider and flagd, broken connections in the line can cause a provider never to get updates of chaged flag configurations. The provider never recognizes broken e2e connections because it only listens on the RPC stream and never sends data.
This feature forces a client to open a new GRPC stream after the deadline is exceeded.
Notes
Default stream deadline is 10 Minutes. Deadlines can be disabled by setting it to
0
.