-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Workers & top-level-await changed behavior between 1.4.6 and 1.6.0 #8735
Comments
@soootaleb in Unfortunately linked code can't really be used as a test case, could you try to boil down reproduction? |
@bartlomieju thanks a lot for your reactivity :) Here we go: I created a subfolder with example code on a dedicated branch, see the README, reproducing is easy |
@bartlomieju Hey ! My earlier, deno I can confirm it doesn't come from the http module since Deno I hope you find some time to check that, It's a huge blocker for me and I think an awful bug for any software requiring a non-blocking web server (i.e any software which is not a web service) Thank! |
@soootaleb I will look into this issue, but can't say when. I'll get back to you when I do. |
@soootaleb thanks for repro repo, I've created a test cased based on it in #8809 and confirmed there is an actual bug. It might take some time to fix it though as it requires to alter significant parts of Aside from that, your reproduction has a few quirks that prohibit it to work as expected:
|
Hi @bartlomieju thanks a lot for your insights
I can't wait to see the result, hope you'll notify me when progress is made. Until then, let me know if I can be of any help. Regards |
Not yet fixed: #8839 |
Hello,
I've been implementing a distributed KV Store with Deno recently in version 1.4.6.
I use a worker for the network layer (so that the webserver is not blocking the main program):
serve
function and a top level await to received requests (ugraded to websockets withacceptWebsocket
)self.postMessage
worker.postMessage
in order to send messages on the network (in the WebSocket)This works perfectly in 1.4.6; I declare the
self.onmessage
function before starting the top level await, and the worker runs it when Iworker.postMessage
, even if the top level await is running as a web server.But I tried to bump to Deno 1.6.0, and while the worker is still able to forward incoming messages to the main thread, it seems the self.onmessage handler is no longer called when the main thread posts a message to the worker.
I identified the top level await to be responsible since commenting it allows
self.onmessage
to be called correctly.I've tried to explore the latest changes and issues, but I didn't find anything mentioning a change in behavior regarding the blocking / threading behaviors or workers / top level awaits.
Can anyone enlighten me ?
Regards
NB: The worker code is here https:/soootaleb/abcd/blob/master/src/net.worker.ts
The text was updated successfully, but these errors were encountered: