-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Many Bad resource ID errors since Deno 1.27.0
#16450
Comments
Thanks! I'll try bisecting those commits tomorrow. I think the issue is only noticeable when there are a lot of connections. (We have about 200 connections per server). That could explain why the tests didn't catch it. |
@jespertheend I'm not able to reproduce Bad Resource IDs with >200 connections. Can you share releavent code around |
My theory is that #16320 's optimization made |
Actually nvm, there is a |
36307c4 (#16320) doesn't seem to have the issue. I'll try different commits and report if I find anything. My send code looks like this: /**
* @param {number[] | ArrayBufferLike} data
*/
send(data) {
if (data instanceof Array) {
data = (new Uint32Array(data)).buffer;
}
try {
if (this.rawConnection.readyState == WebSocket.OPEN) {
this.rawConnection.send(data);
}
} catch (e) {
console.error("Failed to send message to connection", e);
}
} The clients are sending a bunch of data about 20 times per second. So maybe making 200 connections isn't enough on its own to trigger the errors. |
@jespertheend can you try to reproduce this in canary? I was not able to reproduce the errors so not entirely sure if #16454 fixed it |
Unfortunately that does not seem to fix it, I do notice a difference though. It seems like it no longer throws an error during |
we are experiencing the same issue: socket just dies/hangs on sending |
I guess this doesn't come as a surprise, but I tried f5cb26a on our production servers and can confirm that it's fixed. |
Good to hear @jespertheend. It will be released today in v1.27.1 |
Apparently I had newly created servers set to automatically download the latest version of Deno (I guess I should have pinned the version), but since 1.27.0 released earlier today websocket connections have been closing abruptly and my logs are full of "Bad resource ID" errors. The errors specifically happen during the
WebSocket.send()
call.I'm still investigating what the issue specifically could be, but I'm afraid I'll have to resort to bisecting Deno in production. Did anything change about WebSockets internally?
The text was updated successfully, but these errors were encountered: