Skip to content

TCP RST and 502 errors when pods are terminated #7935

@tweeks-reify

Description

@tweeks-reify

Issue Description

We see 502 errors when an apollo-server pod is gracefully terminated in k8s. We host apollo-server in EKS and expose it using AWS ALBs.

AWS provides a troubleshooting guide for 502s and we can see our issue falls under the criteria for "The load balancer received a TCP RST from the target when attempting to establish a connection" (see screenshot below).

We attempted to increase the stopGracePeriodMillis in ApolloServerPluginDrainHttpServer to be higher than the kubernetes terminationGracePeriodSeconds and the ALB Target Group deregistration_delay but did not see a change in behavior.

We also have set httpServer.keepAliveTimeout and httpServer.headersTimeout higher than our ALB Session Timeout.

ALB Logs

Link to Reproduction

https://repost.aws/knowledge-center/elb-alb-troubleshoot-502-errors

Reproduction Steps

  1. Terminate a pod running running apollo-server in EKS behind an AWS ALB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions