Skip to content

Conversation

conico974
Copy link
Contributor

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.

Copy link

changeset-bot bot commented Aug 8, 2024

🦋 Changeset detected

Latest commit: c18999c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
open-next Patch
app-pages-router Patch
app-router Patch

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

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
open-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 3:16pm

Copy link
Contributor

@khuezy khuezy left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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 ).

Copy link
Contributor

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.

Copy link
Contributor Author

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

@conico974 conico974 merged commit 8ddb621 into opennextjs:main Aug 20, 2024
@conico974 conico974 deleted the fix/streaming-hang branch October 29, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants