chore: Update dist

This commit is contained in:
GitHub Actions
2024-06-25 03:28:22 +00:00
parent 1b9c66a165
commit b4ffe2aa11
Generated Vendored
+36 -15
View File
@@ -16784,10 +16784,12 @@ var _NodeHttpHandler = class _NodeHttpHandler {
* @internal * @internal
* *
* @param agent - http(s) agent in use by the NodeHttpHandler instance. * @param agent - http(s) agent in use by the NodeHttpHandler instance.
* @param socketWarningTimestamp - last socket usage check timestamp.
* @param logger - channel for the warning.
* @returns timestamp of last emitted warning. * @returns timestamp of last emitted warning.
*/ */
static checkSocketUsage(agent, socketWarningTimestamp) { static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
var _a, _b; var _a, _b, _c;
const { sockets, requests, maxSockets } = agent; const { sockets, requests, maxSockets } = agent;
if (typeof maxSockets !== "number" || maxSockets === Infinity) { if (typeof maxSockets !== "number" || maxSockets === Infinity) {
return socketWarningTimestamp; return socketWarningTimestamp;
@@ -16801,11 +16803,11 @@ var _NodeHttpHandler = class _NodeHttpHandler {
const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0;
const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0;
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
console.warn( (_c = logger == null ? void 0 : logger.warn) == null ? void 0 : _c.call(
"@smithy/node-http-handler:WARN", logger,
`socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.`, `@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
"See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html", See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
"or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config." or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`
); );
return Date.now(); return Date.now();
} }
@@ -16831,7 +16833,8 @@ var _NodeHttpHandler = class _NodeHttpHandler {
return httpsAgent; return httpsAgent;
} }
return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
})() })(),
logger: console
}; };
} }
destroy() { destroy() {
@@ -16853,6 +16856,7 @@ var _NodeHttpHandler = class _NodeHttpHandler {
}, "resolve"); }, "resolve");
const reject = /* @__PURE__ */ __name(async (arg) => { const reject = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise; await writeRequestBodyPromise;
clearTimeout(socketCheckTimeoutId);
_reject(arg); _reject(arg);
}, "reject"); }, "reject");
if (!this.config) { if (!this.config) {
@@ -16868,7 +16872,11 @@ var _NodeHttpHandler = class _NodeHttpHandler {
const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
socketCheckTimeoutId = setTimeout( socketCheckTimeoutId = setTimeout(
() => { () => {
this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(
agent,
this.socketWarningTimestamp,
this.config.logger
);
}, },
this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3) this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)
); );
@@ -16915,12 +16923,17 @@ var _NodeHttpHandler = class _NodeHttpHandler {
setConnectionTimeout(req, reject, this.config.connectionTimeout); setConnectionTimeout(req, reject, this.config.connectionTimeout);
setSocketTimeout(req, reject, this.config.requestTimeout); setSocketTimeout(req, reject, this.config.requestTimeout);
if (abortSignal) { if (abortSignal) {
abortSignal.onabort = () => { const onAbort = /* @__PURE__ */ __name(() => {
req.abort(); req.destroy();
const abortError = new Error("Request aborted"); const abortError = new Error("Request aborted");
abortError.name = "AbortError"; abortError.name = "AbortError";
reject(abortError); reject(abortError);
}; }, "onAbort");
if (typeof abortSignal.addEventListener === "function") {
abortSignal.addEventListener("abort", onAbort);
} else {
abortSignal.onabort = onAbort;
}
} }
const httpAgent = nodeHttpsOptions.agent; const httpAgent = nodeHttpsOptions.agent;
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
@@ -16931,7 +16944,10 @@ var _NodeHttpHandler = class _NodeHttpHandler {
keepAliveMsecs: httpAgent.keepAliveMsecs keepAliveMsecs: httpAgent.keepAliveMsecs
}); });
} }
writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
clearTimeout(socketCheckTimeoutId);
return _reject(e);
});
}); });
} }
updateHttpClientConfig(key, value) { updateHttpClientConfig(key, value) {
@@ -17199,12 +17215,17 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
}); });
} }
if (abortSignal) { if (abortSignal) {
abortSignal.onabort = () => { const onAbort = /* @__PURE__ */ __name(() => {
req.close(); req.close();
const abortError = new Error("Request aborted"); const abortError = new Error("Request aborted");
abortError.name = "AbortError"; abortError.name = "AbortError";
rejectWithDestroy(abortError); rejectWithDestroy(abortError);
}; }, "onAbort");
if (typeof abortSignal.addEventListener === "function") {
abortSignal.addEventListener("abort", onAbort);
} else {
abortSignal.onabort = onAbort;
}
} }
req.on("frameError", (type, code, id) => { req.on("frameError", (type, code, id) => {
rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));