Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#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 elexis)

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)

t3423_reproduce_lag_crash.patch (505 bytes ) - added by elexis 9 years ago.
Freezes 40 seconds when sending a chat message. This freeze will cause enet to kill the host.

Download all attachments as: .zip

Change History (7)

comment:1 by elexis, 9 years ago

Description: modified (diff)

comment:2 by Stan, 9 years ago

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.

by elexis, 9 years ago

Freezes 40 seconds when sending a chat message. This freeze will cause enet to kill the host.

in reply to:  2 comment:3 by elexis, 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:4 by elexis, 9 years ago

Resolution: duplicate
Status: newclosed

Same as #2854

comment:5 by Stan, 9 years ago

Milestone: Backlog

comment:6 by elexis, 8 years ago

Component: Core engineNetwork

(set component to network)

Note: See TracTickets for help on using tickets.