Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
|
the failing test is also failing on v2 |


🔗 Linked issue
nuxt/cli#1531
nuxt/cli#1532
resolves #4610
❓ Type of change
📚 Description
if a websocket connection to the dev worker is still open when the dev server closes,
close()never resolves. the upstream nuxt/cli issue was thatnuxt devjust hung for 15s (windows only, interestingly) until it hit a timeout:w've worked around this in nuxt/cli#1532, but I think this is a bug worth fixing in nitro too (I've included a pure-nitro regression test that times out without the fix)
the issue is that:
closeAllConnectionsdoesn't cover upgraded sockets, solistener.close()waits as long as the websocket stays open and we never send the exit event#closeWorker, the graceful-shutdown timeout logs but never resolvesso, this PR destroys any upgraded sockets in
shutdown()alongsidecloseAllConnections(), and resolves on timeout so we fall through toterminate()as intendedI think the reason existing tests didn't catch it was that we skip the graceful wait in test/CI environments. I've mocked
std-envin the new test so we can avoid a regression in futuremany thanks to @userquin for his helpful work finding the cause and opening issues in nuxt/cli + nitro ❤️
📝 Checklist