-
Notifications
You must be signed in to change notification settings - Fork 172
fix lambda streaming hanging after return #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: c18999c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS!!!
responseStream, | ||
context, | ||
): Promise<AwsLambdaReturn> => { | ||
context.callbackWaitsForEmptyEventLoop = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't Dax add this to the sst
layer at one point, which broken open-next
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did he ? He did it in the remix server in ion, and at the time i tried it in OpenNext as well ( to fix the 30s hanging issue ), but it ended up causing issue with ISR because of the pending promise ( at the time i didn't know that ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have misremembered, but iirc he added that to the base SSR construct in sst
. Things may be changed now, but it was many months ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're probably right actually, i thought you were talking about the remix stuff.
Anyway it works now
It looks like aws has made an update again to how the runtime works when using streaming.
Now even after
end()
has been called on the stream and the handler returned, the lambda keeps running in the background doing nothing until it timeout (and you'll be billed for the full duration)This should fix it.