Skip to content
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

WebSocket messages are not being sent. #16511

Closed
jespertheend opened this issue Nov 2, 2022 · 14 comments · Fixed by #16743
Closed

WebSocket messages are not being sent. #16511

jespertheend opened this issue Nov 2, 2022 · 14 comments · Fixed by #16743
Assignees

Comments

@jespertheend
Copy link
Contributor

I did some more testing on f5cb26a and unfortunately it appears like some messages are not being sent somehow. The reason why I believe this is the case is that when switching between 1.26.2 and f5cb26a a bug is introduced that causes players to not respawn. They keep running around while the player model is still rendered in the 'dead' state. So my guess is that the server isn't sending the 'respawn' message for some reason.
I haven't changed any of my code which leads me to believe something in Deno has changed that causes the messages to not get sent. I've also observed other instances that seem to suggest messages are not being sent, like certain in game events not happening for some of the players.

I'll try to make a reduced test case, but I'm worried that similar to #16450 this is something that can only be reproduced with a lot of traffic from different clients.

@littledivy
Copy link
Member

Does it happen without 36307c4 ?

@jespertheend
Copy link
Contributor Author

That's what I'd like to know as well, but I can't easily test this because it suffers from #16450

@jespertheend
Copy link
Contributor Author

Ah sorry, I see now that was comitted before e3a3095, I'll try it out 👍

@jespertheend
Copy link
Contributor Author

Both 57f17bd and 36307c4 do not seem to suffer from the issue.

@littledivy
Copy link
Member

Ah ok. So the bad commit might be somewhere between 0750b32 and 204c46d

@littledivy
Copy link
Member

Hmm none of the commits directly deal with WebSocket

@jespertheend
Copy link
Contributor Author

I'm not sure where you derived those two commits from since both were comitted before 36307c4, which is still good.
Could it be that d760141 has something to do with it?

I might be able to bisect this in production again, but I'll have to figure out a way to get custom builds on our servers. And even then it will still be a long and painful process since every commit will take well over 30 minutes to build, upload and verify. So if anyone has any better ideas I'm very much open for suggestions.

@littledivy
Copy link
Member

On Linux you can do deno upgrade --canary <commit>

@jespertheend
Copy link
Contributor Author

That's what I've been using until now. But if the offending commit lies somewhere after e3a3095 I won't be able to test because of #16450. So I'm afraid making custom builds is the only way.

@jespertheend
Copy link
Contributor Author

jespertheend commented Nov 4, 2022

I think I may have found the issue. It seems like the revert in f5cb26a accidentally removed a small portion of an unrelated commit: bfc1fb8

if (this.binaryType === "blob") {
data = new Blob([value]);
} else {
data = value.buffer;
}

Line 437 should be data = value;

edit: hmm never mind, I don't think that's it

@jespertheend
Copy link
Contributor Author

It took a while but I finally managed to do a full bisect and it seems like this definitely started happening after d760141

@sgwilym
Copy link
Contributor

sgwilym commented Nov 15, 2022

Argh! I spent an afternoon tearing my hair out over where websocket messages were disappearing to, until I began to wonder if Deno's Websocket implementation was just plain broken. Downgrading to Deno 1.26.2 fixed it.

This is quite a horrible bug because it fails silently. I hope no-one has to waste their time like I had to!

Edit: like @jespertheend, this surfaced in a scenario with many messages being sent in a short period of time. However in my case it was happening between a single client and a (locally running) server.

@sgwilym
Copy link
Contributor

sgwilym commented Nov 21, 2022

Is there a chance for this being fixed in 1.29? Websockets not working if you send lots of messages quickly is now keeping me from updating past 1.26.2.

@jespertheend
Copy link
Contributor Author

Yeah same here. You can revert d760141 and make a custom build but it's not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants