-
Notifications
You must be signed in to change notification settings - Fork 652
Open
Labels
p2This is a standard priority issueThis is a standard priority issue
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
When calling PostToConnection to an endpoint that might not respond, no timeout is used even if one is set.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-apigatewaymanagementapi v3.965.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v24.11.1
Reproduction Steps
Timeout appears to be ignored, which was observed in #6896 but closed prematurely.
Simple slow-responding server PoC
import express from "express";
const app = express();
const PORT = 3000;
async function response(req, res) {
// Respond slowly
await new Promise((resolve) => setTimeout(resolve, 10_000));
res.send("hello");
}
app.use(response);
app.listen(PORT, (err) => {
if (err) {
console.error(err);
return;
}
console.log(`Listening on port ${PORT}`);
});Try to access this endpoint with a short timeout set
import {
ApiGatewayManagementApiClient,
PostToConnectionCommand,
} from "@aws-sdk/client-apigatewaymanagementapi";
const client = new ApiGatewayManagementApiClient({
endpoint: "http://localhost:3000/",
logger: console,
});
await client.send(
new PostToConnectionCommand(
{
ConnectionId: "conn",
Data: new TextEncoder().encode("hello"),
},
{ requestTimeout: 5 }
)
);Observed Behavior
Process exited after 10 seconds
Expected Behavior
Process should have exited after 5 seconds (or 5 milliseconds, I couldn't find documentation on requestTimeout)
Possible Solution
No response
Additional Information/Context
No response
matyas-szert-easyjet
Metadata
Metadata
Assignees
Labels
p2This is a standard priority issueThis is a standard priority issue