Function URL invoke hangs when the response stream is empty
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- aws, node.js, typescript
Rechercherichtung
Beginne mit der Reproduktion in index.cjs unter Verwendung von awslambda.streamifyResponse, HttpResponseStream.from, pipeline und Readable.from(Buffer.alloc(0)) in einem Function-URL-Aufruf. Führe sie in us-east-1 aus und vergleiche das Verhalten älterer und neuerer Accounts. Erledigt ist die Aufgabe, wenn ein leerer Antwortstream mit statusCode 403 die Clientverbindung schließt, statt hängen zu bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 224
- Forks
- 60
- Ø Merge
- 26 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus aws/aws-lambda-nodejs-runtime-interface-client
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
aws/aws-lambda-nodejs-runtime-interface-client#198 · 3 Kommentare · 6 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
aws/aws-lambda-nodejs-runtime-interface-client#195 · 12 Reaktionen ·
-
bug
aws/aws-lambda-nodejs-runtime-interface-client#170 · 15 Kommentare · 6 Reaktionen · 1 zugewiesene Person ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
aws/aws-lambda-nodejs-runtime-interface-client#159 · 2 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
aws/aws-lambda-nodejs-runtime-interface-client#145 · 1 Kommentar · 6 Reaktionen ·
Alle Issues in aws/aws-lambda-nodejs-runtime-interface-client
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
ontola/atomic-server#1625 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
melgarafael/DeskcommCRM#1451 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
bug via-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
midnightntwrk/midnight-sdk#403 ·