(cli): deploy waits forever when an AWS API call gets no response, because requestTimeout only logs a warning
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- aws, node.js, typescript
Direzione di ricerca
Inizia con sdkRequestHandler in packages/@aws-cdk/toolkit-lib/lib/api/aws-auth/awscli-compatible.ts e verifica come il gestore delle richieste Smithy configura i timeout. Confronta il comportamento di requestTimeout, socketTimeout e throwOnRequestTimeout con la riproduzione blackhole nell’issue. Il lavoro è completato quando una chiamata all’API AWS che non risponde raggiunge il timeout, passa attraverso la strategia di ripetizione esistente e infine fallisce con un errore se i tentativi sono esauriti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
cdk deploy can wait forever on a single AWS API call that never gets a response.
sdkRequestHandler in packages/@aws-cdk/toolkit-lib/lib/api/aws-auth/awscli-compatible.ts builds every SDK client's request handler with connectionTimeout: 10_000 and requestTimeout: 300_000, but without throwOnRequestTimeout and without socketTimeout. In Smithy's NodeHttpHandler, a requestTimeout without throwOnRequestTimeout only logs a warning. The request is never destroyed, so the SDK's retry strategy never sees an error. If the connection has silently died after it was established, the CLI waits on it forever.
We have hit this twice in production deploys from GitHub Actions in the last two weeks, out of about 1,000 deploys since July. Both times, the CLI stopped reporting progress for one stack, logged this warning, and then printed nothing more:
@smithy/node-http-handler - [WARN] a request has exceeded the configured 300000 ms requestTimeout. Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.
- Oct 19 2026: the warning appeared at 13:31:03 UTC. The job was cancelled by hand about 42 minutes later.
- Oct 27 2026: the stack reached
UPDATE_COMPLETEin CloudFormation at 02:47:24 UTC. The warning appeared at 02:49:35, and the job ran until GitHub's 6-hour job timeout cancelled it at 08:43:59. Because our deploy job is serialized, it also blocked the next release for almost 6 hours.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
An AWS API call that gets no response should time out, be retried by the SDK's retry strategy like any other transient network error, and fail the command with an error if the retries run out.
Current Behavior
The CLI keeps waiting on the same request with no further output. It never retries and never exits, until something outside the CLI kills it. On 2.1107.0 it logs @smithy/node-http-handler - [WARN] a request has exceeded the configured 300000 ms requestTimeout after 5 minutes. On 2.1146.1 it printed nothing at the default verbosity.
Reproduction Steps
- Start a server that accepts TCP connections and never replies. Save this as
blackhole.pyand runpython3 blackhole.py:
import socket, threading
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(("127.0.0.1", 8999))
s.listen(50)
held = []
def hold(c):
held.append(c)
try:
while c.recv(65536):
pass
except OSError:
pass
while True:
c, _ = s.accept()
print("accepted a connection; never replying", flush=True)
threading.Thread(target=hold, args=(c,), daemon=True).start()
- In another shell, point the CLI at it. The credentials are dummies and nothing reaches AWS:
AWS_ACCESS_KEY_ID=AKIAEXAMPLEEXAMPLE AWS_SECRET_ACCESS_KEY=dummy AWS_REGION=us-east-1 \
AWS_ENDPOINT_URL=http://127.0.0.1:8999 CDK_DISABLE_CLI_TELEMETRY=1 \
npx [email protected] bootstrap aws://123456789012/us-east-1 --no-notices
- The server accepts one connection, and the CLI prints
Bootstrapping environment aws://123456789012/us-east-1...and then waits.
We ran this on 2.1107.0 and 2.1146.1 and killed each after 7 minutes. Neither version opened a second connection, so the call was never retried. 2.1107.0 logged the requestTimeout warning at the 5-minute mark. 2.1146.1 printed no warning at the default verbosity, so on the latest release the hang has no output at all.
Possible Solution
Set a socketTimeout in sdkRequestHandler, for example 60 to 120 seconds. When no data moves on the connection for that long, Smithy destroys the request and rejects with a TimeoutError. isTransientError classifies that as retryable, so the existing retry strategy handles it. Unlike requestTimeout, it does not fire on a slow request that is still sending data, such as a large asset upload.
Setting throwOnRequestTimeout: true would also work, because the resulting error (name TimeoutError, code ETIMEDOUT) is retryable too. But requestTimeout runs from the start of the request until the response headers arrive, including the whole request body, so it would also abort a healthy upload that takes longer than 5 minutes.
Either way, it would help to make these timeouts configurable. Today the only HTTP setting the CLI accepts from outside is the proxy agent.
Additional Information/Context
Both occurrences were on the same third-party GitHub Actions runner provider, and we have not seen it on GitHub-hosted runners. Whatever drops the connection, the CLI should recover rather than wait forever.
Related, but different:
- #1217 is about the process not exiting after the command has finished. Here the command never finishes: the CLI is still waiting for a stack's status.
- #1500 capped the retry backoff for calls that return an error. A call that gets no response at all never reaches the retry logic.
CDK CLI Version
2.1107.0 (also reproduced on 2.1146.1)
Framework Version
aws-cdk-lib 2.240.0
Node.js Version
24.22.1
OS
Ubuntu 24.04 (GitHub Actions runner)
Language
TypeScript
Language Version
TypeScript 5.9.3
Other information
No response
- Lingua principale
- TypeScript
- Stelle
- 110
- Fork
- 138
- Merge medio
- 1g 9h
- PR unite (30g)
- 56
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-cdk-cli
-
aws-cdk bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws/aws-cdk-cli#2179 ·
I maintainer di solito rispondono entro 1 giorno
-
(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN valueForse già presa @lemon0333 l’ha presa 95 giorni fa. Apertabug p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
aws/aws-cdk-cli#921 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
(garbage-collection): cdk gc takes hours on a large bootstrap bucketForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
aws/aws-cdk-cli#2165 ·
I maintainer di solito rispondono entro 1 giorno
-
(cli): cdk flags --set always reports no template differences before applying flagsForse già presa @go-to-k l’ha presa 9 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
aws/aws-cdk-cli#2153 ·
I maintainer di solito rispondono entro 1 giorno
-
integ-runner: update workflow fails when deploying an existing snapshotForse già presa @gibkim l’ha presa 11 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
aws/aws-cdk-cli#2150 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws/aws-cdk-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
volcengine/OpenViking#8432 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
jupyterlab/eslint-plugin#178 · 2 commenti ·
-
bug from-app needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightly-labs/openbot#16303 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100