Add optional maxConnectionAge and maxConnectionAgeGrace support to G…#143
Add optional maxConnectionAge and maxConnectionAgeGrace support to G…#143Gg-harness merged 2 commits intomainfrom
Conversation
…rpcPlatformServerDefinition AI-Session-Id: c5dae67b-13fb-4369-80af-7b15a26bfbdf AI-Tool: claude-code AI-Model: unknown
There was a problem hiding this comment.
sorry dependencies are a bit out of date in this whole org. To get this passing
- suppress the grpc-go vuln: hypertrace/github-actions#91
- update avro: hypertrace/kafka-streams-framework#118
- pull that framework version into the bom, once merged and released
- optional: probably add avro to the bom too. It really should be there, not in the kafka framework.
- finally, update the locks here
@aaron-steinfeld First 2 PRs are good. What dependency does this have on the kafka streams framework though?
Did you edit my comment? 🤨 I'm not sure what repo's dependency check I was looking at that flagged the avro version - maybe it was the BOM? Looks like this one is green with just the suppression, so we can close the avro upgrade until/unless needed. |
Yeah sorry, missed the Quote Reply option there :D
Cool. I will go forward with this one then |
Description
Adds support for configuring maxConnectionAge and maxConnectionAgeGrace on the gRPC Netty server via GrpcPlatformServerDefinition.
Problem
Currently, gRPC connections to services built on this framework are long-lived with no upper bound on connection lifetime.
Once a persistent HTTP/2 connection is created at the time of DNS resolution, it sticks to the resolved pods and there is no rotation.
Solution
Two new optional fields on GrpcPlatformServerDefinition:
maxConnectionAgeInSeconds : Maximum time a connection may exist before the server sends a GOAWAY.
maxConnectionAgeGraceInSeconds: Grace period after GOAWAY for in-flight RPCs to complete before the connection is forcibly closed.
These are wired into NettyServerBuilder.maxConnectionAge() and NettyServerBuilder.maxConnectionAgeGrace() in GrpcPlatformServiceContainer.initializeBuilder()
Changes
GrpcPlatformServerDefinition.java — Added maxConnectionAgeInSeconds and maxConnectionAgeGraceInSeconds fields with @Builder.Default of 0.
GrpcPlatformServiceContainer.java — Apply the new fields on the NettyServerBuilder in initializeBuilder() when values are > 0.
Backward compatibility
Fully backward compatible. Both fields default to 0, which preserves the existing behavior (no connection age limit). No changes required in existing consumers.
Testing