#3423 closed defect (duplicate)
Crash after 30 seconds of lag
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Must Have | Milestone: | |
Component: | Network | Keywords: | |
Cc: | Patch: |
Description (last modified by )
If you host a game and your computer freezes for more than 30 seconds for some reason (for example sunken ship lag r16636, or having 0ad installed on an external harddrive that goes to standby mode), then the game will end for all players.
This is due to a default timeout value of 30 seconds in enet ( http://enet.bespin.org/ ) and once the local client / host disconnects, it's over.
We should disable it / set it to infinite for the local client / host:
// enet_peer_timeout(event.peer, 0, 0, 10000);
This issue has been reported in ticket:3264#comment:3. We should fix it here, so that we can decide on reasonable client timeout values in that ticket.
Attachments (1)
Change History (7)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 9 years ago
by , 9 years ago
Attachment: | t3423_reproduce_lag_crash.patch added |
---|
Freezes 40 seconds when sending a chat message. This freeze will cause enet to kill the host.
comment:3 by , 9 years ago
Replying to stanislas69:
I'm not sure disabling it is the right solution. That means if the host computer crashes the game will be still there, and I guess that can cause some other issues.
In case the host has a +30 second timeout, the other clients will still disconnect. I'm not sure yet how to handle the other clients (to be done in #3264), but I'm sure that we don't want the "hosting client" to timeout from its own server and causing the game to end.
That it is exactly 30 seconds (at most) can be seen in the code:
include/enet/enet.h: ENET_PEER_TIMEOUT_LIMIT = 32, include/enet/enet.h: ENET_PEER_TIMEOUT_MINIMUM = 5000, include/enet/enet.h: ENET_PEER_TIMEOUT_MAXIMUM = 30000,
ENet has some fancy algorithm to disconnect earlier if there is less lag and waits longer when there is much.
comment:5 by , 9 years ago
Milestone: | Backlog |
---|
I'm not sure disabling it is the right solution. That means if the host computer crashes the game will be still there, and I guess that can cause some other issues.
Maybe setting it to something like 5minutes would be better.