-
Notifications
You must be signed in to change notification settings - Fork 293
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
Workerd fails to send webSocketAutoResponse for Durable Object Hibernate API in local development. #1009
Comments
Note, I was asked by @milan_cf on Discord to open the bug under workerd. |
cc @MellowYarker (aka milan_cf on Discord) |
@jqmmes is looking into this, we think we know the issue but need to get a repro. He's out for the week so I may pick up when I have a chance. |
Thanks for looking into this. I'm working on creating a repo with code that produces the bug. Will post here tomorrow. |
Here's a repo that reproduces the bug. Instructions are in the readme file. |
@MellowYarker & @jqmmes mmes, any thoughts on when this bug may be looked into? |
@safaalai we've identified a problem and have been working on a fix, sorry for not updating here. We found a race condition that broke a requirement of our library's websocket implementation; fix looked easy enough at a glance, but has turned out to be somewhat complicated. I expect the update will be in next weeks release, not exactly sure when wrangler updates its Workerd version but @jqmmes will comment here when it's ready 🙂 Thanks for your patience! |
@MellowYarker any more news on this? |
#1130 we actually discussed this yesterday, should be okay with this approach and will be getting reviewed this week. |
A PR that fixes this issue was merged, but it's still waiting to release in wrangler. |
@jqmmes Just checking in. Any ideas when this may be released in Wrangler? |
@safaalai this fix was briefly reverted, but it's going to be merged once again soon. I don't have an ETA for the wrangler release yet, but I think it won't take long. |
Which Cloudflare product(s) does this pertain to?
Pages, Durable Objects, Wrangler dev
What version(s) of the tool(s) are you using?
3.5.0 Wrangler
What version of Node are you using?
18.16.1
What operating system are you using?
Mac OS 13.2.1
Describe the Bug
Workerd fails to send webSocketAutoResponse for Durable Object Hibernate API in local development.
Definitions
normal message = message processed by webSocketMessage handler which sends back an ack.
ping message = message processed by webSocketAutoResponse handler which sends back a pong
I start a pages project for local development using
npx wrangler pages dev -- npm start
. npm start kicks off my dev server which is proxied by wrangler. This project uses a pages function and a durable object to setup a webSocket connection using the Durable Object Hibernate API. The project uses webSocketAutoResponse to setup a 'pong' response for every 'ping' request.I get the following results when I try to send messages from the client to the server:
Looking at the DO logs, any time auto messages are involved, (i.e. 'ping' message cases #3, #4, #5 above), I get:
workerd/jsg/util.c++:275:` error: e = kj/compat/http.c++:3421: failed: expected !currentlySending; another message send is already in progress stack: 10b9e595f 10b9e3338 10b9f7ccd 10b9f07fe 10b9fb371 10b9f7ccd 10b9f07fe 10b9fb371 10b9f7ccd 10b9f07fe 10b9fb371 10b0ce270; sentryErrorContext = jsgInternalError Client error Error: internal error { stack: Error: internal error, message: internal error }
The text was updated successfully, but these errors were encountered: