Is sending to WebSockets from a DO fully blocking?
We have a simple DO that clients connect to via WS and we use hibernation. The DO has an endpoint that our backend can hit to send out a broadcast to all connected clients.
Sometimes the trigger http call times out, even after 5 retries with backoff. My first attempt to fixing this was to change the trigger endpoint to just schedule an alarm, which then handles the sending, but that didn't help.
I assume that is because the DO is single-threaded and so, if the alarm is running, all incoming requests are blocked.
Today I noticed that this happened even though only ~10 connections were open, so the only explanation I have is that one of them is semi-broken, or just very slow, and that the send() call is fully blocking.
Is that the case? If so, why? This seems to a unnecessarily strict, as sending a WS message could just put it into an outbound queue.
Sometimes the trigger http call times out, even after 5 retries with backoff. My first attempt to fixing this was to change the trigger endpoint to just schedule an alarm, which then handles the sending, but that didn't help.
I assume that is because the DO is single-threaded and so, if the alarm is running, all incoming requests are blocked.
Today I noticed that this happened even though only ~10 connections were open, so the only explanation I have is that one of them is semi-broken, or just very slow, and that the send() call is fully blocking.
Is that the case? If so, why? This seems to a unnecessarily strict, as sending a WS message could just put it into an outbound queue.
