Function URL invoke hangs when the response stream is empty
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- aws, node.js, typescript
Research direction
Start with the index.cjs reproduction using awslambda.streamifyResponse, HttpResponseStream.from, pipeline, and Readable.from(Buffer.alloc(0)) in a Function URL invocation. Run it in us-east-1 and compare the older and newer account behavior. Done means an empty response stream with statusCode 403 closes the client connection instead of hanging.
Written by the indexing model from the issue text.
Description
I have a lambda with response streaming enabled. Invoked via Function URL. I am trying to return a status code with no response body. I have reduced my code to the below sample to reproduce the issue:
// File: index.cjs
// Handler: index.handler
const pipeline = require("util").promisify(require("stream").pipeline);
const { Readable } = require("stream");
exports.handler = awslambda.streamifyResponse(async (event, responseStream, context) => {
responseStream = awslambda.HttpResponseStream.from(responseStream, {
statusCode: 403,
});
await pipeline(
Readable.from(Buffer.alloc(0)),
responseStream,
);
});
I can see the HTTP headers are sent correctly and received by the client. But the connection remains open for up to 16 minutes. It seems like the runtime expects a response body, and if there is none, it just hangs and does not close the connection.
What's even stranger is that I have tested this in 2 different accounts. One of the accounts has been created ages ago, and the code above actually works fine as one would expect. The other account is newer (and it's where that code is supposed to run), and it just hangs and doesn't close the connection. Region is us-east-1.
- Dominant language
- TypeScript
- Stars
- 224
- Forks
- 60
- Avg merge
- 26m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-nodejs-runtime-interface-client
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
aws/aws-lambda-nodejs-runtime-interface-client#198 · 3 comments · 6 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
aws/aws-lambda-nodejs-runtime-interface-client#195 · 12 reactions ·
-
bug
aws/aws-lambda-nodejs-runtime-interface-client#170 · 15 comments · 6 reactions · 1 assignee ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
aws/aws-lambda-nodejs-runtime-interface-client#159 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
aws/aws-lambda-nodejs-runtime-interface-client#145 · 1 comment · 6 reactions ·
All issues in aws/aws-lambda-nodejs-runtime-interface-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·