Skip to content

Commit c592535

Browse files
committed
chore: add changeset
1 parent 2c67bf6 commit c592535

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.changeset/clean-berries-march.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smithy/node-http-handler": minor
3+
---
4+
5+
destroy isolated http2 session and manage timeout

packages/node-http-handler/src/node-http2-handler.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,7 @@ export class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOptions> {
251251

252252
// Ensure the isolated session is destroyed when the response body stream ends.
253253
// The stream "close" event (below) is the primary cleanup path, but it may not
254-
// fire if the consumer never reads the body (e.g. deserialization error, dropped
255-
// reference) or on certain Node.js versions/platforms. This provides a reliable
256-
// secondary cleanup path.
254+
// fire if the consumer never reads the body. This provides a secondary cleanup path.
257255
clientHttp2Stream.on("end", () => {
258256
ref.destroy();
259257
});
@@ -271,8 +269,7 @@ export class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOptions> {
271269
}
272270
if (!fulfilled) {
273271
// If the session was destroyed (e.g. by sessionTimeout) before the response
274-
// arrived, this is a timeout — type it accordingly so the SDK retry logic
275-
// can classify it as transient.
272+
// arrived, type it as a Timeout so the retry logic kicks in.
276273
const error = new Error("Unexpected error: http2 request did not get a response");
277274
if (session.destroyed) {
278275
error.name = "TimeoutError";

0 commit comments

Comments
 (0)