iceiix/stevenarella

Client doesn't send keep alive packets in all cases, causes client timeout

Opened this issue · 4 comments

While trying to troubleshoot a bug I found, it seems like the client doesn't send keep alive packets while a large amount of packets are being logged to console (I was using network debug).
The client times out after connecting to a vanilla 1.16.1 server.
This is while connecting to an offline server with OPT level set to 3 on a release build.
Main branch with commit 0b4c56b.

Curious if #359 logging to a file would help this, maybe file I/O would be faster than writing to a terminal console (depending on the OS?).

@skillman623 can you retest with 3daa9c0 or newer (which has #359), this logs the detailed log messages to a file instead of the console by default, so it should reduce the likelihood of timing out.

Retested on 72aec0c.
This speeds up load times significantly.
Logging in and loading works for 1.16.1.
This issue somewhat persists- most of the times it works perfectly but in edge cases where the server updates (?) the client (in my case I used /gamemode creative) while the client is loading-for me it's in a jungle so loading can take 15+ seconds before the shadows are loaded, the client sometimes times out.

I've seen similar client timeouts when the client is loading while built for debug mode, it loads too slowly so the server kicks it. Release mode helps due to optimizations, but apparently not enough for all worlds. Chunk building is threaded (src/chunk_builder.rs), but we may need to send keep-alives in a separate thread as well to ensure they don't timeout.