Closed flav-code closed 1 year ago
Are you using the "permessage-deflate" extension? Do you have a reproducible test case? Are you sure that the other peer is still responsive and still sends data?
The parser state 4 means "waiting for data from the other peer".
I can't reproduce the bug
I think something is going on and it's stuck on state 4 I would like to point out that I can still send messages, but in any case I receive them more
I think the other peer just stops sending data. Without a way to reproduce the issue there is not much I can do.
they send well but I think the problem is the customer
The only way to get stuck on state 4 is this https://github.com/websockets/ws/blob/8.12.0/lib/receiver.js#L427, so I guess data is no longer read/flowing. I have not idea why.
I will check if _loop is equal to false
I just had the bug again and I see that the _loop property remains locked at true
How and when are you logging that? Please provide more details, otherwise it is not really useful. If it is truly stuck in an endless loop, your app would be completely blocked with 100% CPU usage.
I have a discord bot and i use a librairie https://github.com/Deivu/Shoukaku to connect to a lavalink server to play music. The author is @Deivu Ws._receiver
I have no particular option
The cpu process is not 100%.
The cpu process is not 100%.
Then it is not stuck in an endless loop.
When issue occurs check
websocket._socket.prependListener('data', function (chunk) {
console.log(chunk.toString('hex'));
});
I found the data from yesterday, I will add the listener as soon as the problem returns The socket is not paused
I added the listener and I get good data
Show the data so we have a way to reproduce the issue.
I am constantly receiving data so I can't tell which one is causing the problem. The socket doesn't even send me an error.
If you can share the data, save it in a file, then when issue occurs post the file here. Use all the data, from the moment the WebSocket
is created to the moment the issue occurs.
@flav28 when you write to the file use something to separate each chunk of data. For example, if you use the hex form as in the example above, then keep the new line between each chunk.
Yes, so that you can distinguish the elements and test them one by one. I can make you an array or a txt
I made a system where I keep the last 10 000 events, I push the chunk in hex in an array and I am warned in the 5s after the incident and I make a command and it generates me a json with an array of chunck
I made a system where I keep the last 10 000 events
The problem with this is that the first element might be a frame without its head. Is it possible to keep everything from the beginning? It's ok if it is a plain txt. Having an array would be convenient but it is not necessary. It can be done later.
actually in my case it's in production the services are already restarting, and I'm convinced that when the problem happens it's because of a corrupted packet or something like that. I can increase the size but I don't want it to impact the system
I don't know your requirements but writing to a file should be acceptable for some time if you have enough space.
well as I said it pushes in an array in ram and as soon as the problem arises I make a command and it will create the file .json with an array of chunck
Any update?
I'm closing this due to inactivity.
Is there an existing issue for this?
Description
From time to time I don't know why but when this state goes to 4 then I don't receive the events anymore and when the problem happens I have no error
ws version
8.12.0
Node.js Version
v18.13.0
System
Expected result
The state must be equal to 0 to works fine
Actual result
Some times the state is 4 and never back to 0
Attachments
No response