Agent version
7.78.1
Bug Report
On EC2 instances with HttpPutResponseHopLimit: 1 and HttpTokens: required, IMDS is unreachable from the agent when it runs in a container. The hop limit drops the IMDSv2 token response before it reaches the container, and IMDSv1 is refused, so no code path can succeed.
cloud_hostinfo retries anyway, every 15s, indefinitely. Each attempt blocks a collector slot for ~600ms waiting on a socket, so roughly 4% of the time a collector slot is occupied doing nothing that can ever succeed.
Please back the IMDS lookup off to 60s after repeated failures.
Reproduction Steps
- Run the agent in a container on an EC2 instance with
HttpPutResponseHopLimit: 1 and HttpTokens: required.
agent status collector — cloud_hostinfo shows ~600ms average execution time, indefinitely.
- From inside the container,
curl -X PUT http://169.254.169.254/latest/api/token -H 'X-aws-ec2-metadata-token-ttl-seconds: 60' hangs until timeout, while curl http://169.254.169.254/latest/meta-data/instance-id returns 401 in under 10ms.
Other environment details
Seen on EKS Auto Mode, whose nodes default to those metadata options, but nothing here is specific to it — any container on a hop-limited instance should reproduce.
Agent version
7.78.1
Bug Report
On EC2 instances with
HttpPutResponseHopLimit: 1andHttpTokens: required, IMDS is unreachable from the agent when it runs in a container. The hop limit drops the IMDSv2 token response before it reaches the container, and IMDSv1 is refused, so no code path can succeed.cloud_hostinforetries anyway, every 15s, indefinitely. Each attempt blocks a collector slot for ~600ms waiting on a socket, so roughly 4% of the time a collector slot is occupied doing nothing that can ever succeed.Please back the IMDS lookup off to 60s after repeated failures.
Reproduction Steps
HttpPutResponseHopLimit: 1andHttpTokens: required.agent status collector—cloud_hostinfoshows ~600ms average execution time, indefinitely.curl -X PUT http://169.254.169.254/latest/api/token -H 'X-aws-ec2-metadata-token-ttl-seconds: 60'hangs until timeout, whilecurl http://169.254.169.254/latest/meta-data/instance-idreturns 401 in under 10ms.Other environment details
Seen on EKS Auto Mode, whose nodes default to those metadata options, but nothing here is specific to it — any container on a hop-limited instance should reproduce.