Skip to content

feat: add application-level keepalive to prevent ALB idle connection timeouts#7

Open
JoshVanL wants to merge 1 commit intodapr:mainfrom
JoshVanL:grpc-keepalive-hello
Open

feat: add application-level keepalive to prevent ALB idle connection timeouts#7
JoshVanL wants to merge 1 commit intodapr:mainfrom
JoshVanL:grpc-keepalive-hello

Conversation

@JoshVanL
Copy link
Copy Markdown

AWS ALBs do not forward HTTP/2 PING frames, causing idle gRPC connections to be closed. This adds a background loop that periodically calls the existing Hello RPC as application-level traffic to keep the connection alive through L7 load balancers.

Copilot AI review requested due to automatic review settings March 11, 2026 18:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an application-level keepalive mechanism to the gRPC worker to prevent idle connections (e.g., behind AWS ALBs) from being closed by periodically invoking the existing Hello RPC.

Changes:

  • Extends TaskHubGrpcWorker constructor to accept an optional keepaliveIntervalMs (defaulting to 30s).
  • Starts a periodic hello(Empty) call once the work-item stream is established.
  • Ensures the keepalive timer is cleared on stop and on stream end/exception paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

…timeouts

AWS ALBs do not forward HTTP/2 PING frames, causing idle gRPC connections
to be closed. This adds a background loop that periodically calls the
existing Hello RPC as application-level traffic to keep the connection
alive through L7 load balancers.

Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL JoshVanL force-pushed the grpc-keepalive-hello branch from 6d5fa45 to 481babc Compare March 11, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants