#2854 closed defect (fixed)
Extensive lag may cause disconnections
Reported by: | scythetwirler | Owned by: | elexis |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 20 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
It seems that extensive lag may cause disconnections (sometimes even the host is disconnected from himself).
If there is a connection timeout, can that be extended?
Change History (12)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Milestone: | Alpha 17 → Alpha 18 |
---|
comment:3 by , 9 years ago
Milestone: | Alpha 18 → Backlog |
---|
comment:5 by , 9 years ago
Summary: | Post-resignation Lag may cause disconnections. → Extensive lag may cause disconnections |
---|
I also experienced this sometimes when the game was laggy and a ship sunk (see sunken ship lag fix r16636). Then I lost the connection to the server although I was the host. I assume that the local client was disconnected from the server due to a timeout. This timeout might be changed for the local client using enet_peer_timeout
.
Replying to historic_bruno:
What is causing the lag? That sounds like the big issue.
There are many things that can cause those lags / performance issues.
I don't think that the timeout for the other clients should be increased though. The causes of the lag must be addressed. I actually think that the timeouts should be decreased, since one waits for up to 30 seconds (ENET_PEER_TIMEOUT_MAXIMUM = 30000
) for clients and people lose the interest in the game meanwhile, see #3264.
comment:6 by , 9 years ago
Priority: | Should Have → Must Have |
---|
As mentioned in #3423, the solution to the problem of the host being disconnected from itself should be to not have a timeout at all for the client that the host uses. Another example for a 30 second timeout is the harddrive going into standby mode and not coming back quickly enough.
The other client timeouts should be handled in #3264.
comment:7 by , 8 years ago
Workaround: The local client is disconnected from the server. But the server isn't closed until one clicks on the exit-game button. It is possible to rejoin the crashed game with a second instance of 0 A.D.
comment:9 by , 8 years ago
Milestone: | Backlog → Alpha 20 |
---|
comment:10 by , 8 years ago
The local client of the host actually became disconnected after a 5 second timeout (since the latency from 127.0.0.1 to 127.0.0.1 is excellent (16ms) and it would disconnect it after a multiple of this time, but not before 5 seconds (see http://enet.bespin.org/group__peer.html#gac48f35cdd39a89318a7b4fc19920b21b)).
Having a 5 second timeout is really easy with an HDD coming back from standby mode.
To reproduce this type of disconnect on linux, just simulate an arbitrary timeout:
function setlag() { for device in "lo"; do sudo tc qdisc del dev $device root netem; if [ $1 -ne 0 ]; then sudo tc qdisc add dev $device root netem delay ${1}ms; fi done }
This can be pushed to A18, but if it can be reduced by changing a constant, then I think that would be an acceptable last-minute "fix".