Skip to content

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

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#49
JoshVanL wants to merge 1 commit intodapr:mainfrom
JoshVanL:grpc-keepalive-hello

Conversation

@JoshVanL
Copy link

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.

@JoshVanL JoshVanL requested a review from a team as a code owner March 11, 2026 17:59
Copilot AI review requested due to automatic review settings March 11, 2026 17:59
Copy link

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 Python TaskHubGrpcWorker to prevent idle gRPC connections from being dropped by L7 load balancers (e.g., AWS ALB) by periodically invoking the existing Hello RPC.

Changes:

  • Introduces a new keepalive_interval constructor parameter and stores it on the worker.
  • Adds an async background _keepalive_loop that periodically calls stub.Hello(...) via an executor thread.
  • Schedules and cancels the keepalive task alongside the work-item stream lifecycle.

💡 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 bbf8a1b to 8c5794a Compare March 11, 2026 18:10
Copy link

@CasperGN CasperGN left a comment

Choose a reason for hiding this comment

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

Thank u @JoshVanL

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.

3 participants