superzanti / ServerSync

Sync files between client and server for Minecraft Forge
GNU General Public License v3.0
163 stars 26 forks source link

Client Timeout Downloading Larger Mod #254

Closed TylzSomeone closed 3 years ago

TylzSomeone commented 3 years ago

Serversync Version: 4.0.0

Minecraft Version: 1.16.5

Issue: Client timeout for 35MB file and 15MB file

In the FAQ on curseforge there is mention of a max file size but I am not sure what that max size is or if it is adjustable. Had no issues syncing the rest of the mods folder when the 2 larger files were removed from the mix.

I noticed another issue (#241) mentioning this but the result was not clear on whether it is a max file size issue or something else. The files are successfully transferred over LAN, as well.

rheimus commented 3 years ago

Do you have the logs? logs/serversync

241 increased the timeout for transferring files to 20 minutes, it should really get refreshed though when bytes are transferred, it is only meant to disconnect inactive connections.

TylzSomeone commented 3 years ago
Log serverysync
[Mar 08, 2021 2:03:56][ServerSync] INFO: Connection established with Socket[addr=/184.XX.XXX.XXX,port=57118,localport=38067]Mar 8, 2021 2:03:56 PM
[Mar 08, 2021 2:03:56][ServerSync] FINE: Reset timeout for client: /184.XX.XXX.XXX, with a timeout of: 120000
[Mar 08, 2021 2:03:56][ServerSync] INFO: Received message: SERVER_INFO, from client: /184.XX.XXX.XXX
[Mar 08, 2021 2:03:56][ServerSync] INFO: Sending server information
[Mar 08, 2021 2:03:56][ServerSync] FINE: Reset timeout for client: /184.XX.XXX.XXX, with a timeout of: 120000
[Mar 08, 2021 2:03:56][ServerSync] INFO: Received message: 4.EServerMessage.GET_MANIFEST, from client: /184.XX.XXX.XXX
[Mar 08, 2021 2:03:57][ServerSync] FINE: Reset timeout for client: /184.XX.XXX.XXX, with a timeout of: 120000
[Mar 08, 2021 2:03:58][ServerSync] INFO: Received message: 5.EServerMessage.UPDATE_FILE, from client: /184.XX.XXX.XXX
[Mar 08, 2021 2:03:58][ServerSync] INFO: Writing C:\Users\Tylz\Desktop\Direwolf Server\mods\minecolonies-0.13.670-ALPHA-universal.jar.DISABLED to client /184.XX.XXX.XXX...
[Mar 08, 2021 2:03:58][ServerSync] FINE: File size is: 37800553
[Mar 08, 2021 2:05:57][ServerSync] INFO: Client connection timed out, closing Socket[addr=/184.XX.XXX.XXX,port=57118,localport=38067]
[Mar 08, 2021 2:05:57][ServerSync] FINE: Failed to write file: C:\Users\Tylz\Desktop\Direwolf Server\mods\minecolonies-0.13.670-ALPHA-universal.jar.DISABLED
[Mar 08, 2021 2:05:57][ServerSync] FINE: [java.net.SocketOutputStream.socketWrite(Unknown Source), java.net.SocketOutputStream.write(Unknown Source), java.io.ObjectOutputStream$BlockDataOutputStream.writeBlockHeader(Unknown Source), java.io.ObjectOutputStream$BlockDataOutputStream.write(Unknown Source), java.io.ObjectOutputStream.write(Unknown Source), com.superzanti.serversync.server.ServerWorker.transferFile(ServerWorker.java:298), com.superzanti.serversync.server.ServerWorker.run(ServerWorker.java:155), java.lang.Thread.run(Unknown Source)]
[Mar 08, 2021 2:05:57][ServerSync] INFO: Finished writing: C:\Users\Tylz\Desktop\Direwolf Server\mods\minecolonies-0.13.670-ALPHA-universal.jar.DISABLED, to client: /184.XX.XXX.XXX
[Mar 08, 2021 2:05:57][ServerSync] INFO: Closing connection with: Socket[addr=/184.XX.XXX.XXX,port=57118,localport=38067]
rheimus commented 3 years ago

Possibly related to #257

rheimus commented 3 years ago

Bumpped to 4.2.0, the performance fix in 4.1.0 should help with this problem but a real fix would be to reset the timeout while the socket is active.

TylzSomeone commented 3 years ago

4.1.0 Did fix my particular issue, thank you.

rheimus commented 3 years ago

Added a timeout refresh whenever data is transferred across the socket to the client, this should avoid timeout issues with larger files. https://github.com/superzanti/ServerSync/releases/tag/v4.2.0