AlecHawes / nullpomino

Automatically exported from code.google.com/p/nullpomino
0 stars 0 forks source link

NetPlay: player timeout / handling of dead connections takes too long #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The problem lies with connections from players, which do not get terminated 
properly by the client side, for example because of an ISP related short 
disconnect of their network/internet access.

When the player reconnects the new player has a (0), (1), etc. added at the end 
of the nick, because of a obvious nickname collision. Because of this we 
already had the case that we there were 4 instances of the same player, 3 of 
which were dead connections of course.

In general it takes too long (many minutes) until the player connection gets 
cleaned up by the netplay server (probably the whole lifetime of the open tcp 
connection / socket on the server side, which is in fact already dead, but 
undetected, because there is no traffic from the server side). 

A simple ping/pong mechanism should be added to the protocol, which checks the 
client every couple seconds with a little request, to which the client must 
respond, to validate the connection is still intact and has not timed out.

Original issue reported on code.google.com by bob.ins...@gmail.com on 29 Oct 2010 at 8:26

GoogleCodeExporter commented 8 years ago
I added some sort of timeout system in r563. It still needs some testing.
Also, the check is done only when someone tries to login.

Original comment by pbomqlu910963@gmail.com on 17 Dec 2010 at 2:08

GoogleCodeExporter commented 8 years ago
this indeed needs more testing, would be good if we can get this fixed for 7.5
I set the value to 5 sec, which seems reasonable - which causes random 
disconnects, directly in the middle of actually playing 40L games on netplay.
I'll keep it at 5000 for now, that you can debug this.

Original comment by bob.ins...@gmail.com on 5 Jan 2011 at 12:17

GoogleCodeExporter commented 8 years ago
ok I tested some more and saw in the server logs that these random disconnects 
seem to be realted to new players login in the server, e.g.:

00:36:44,196 [main] INFO  NetServer: Logout: **ip**
00:36:44,196 [main] INFO  NetServer: xlro !NANNANNANA has logged out
00:36:44,215 [main] INFO  NetServer: RoomDelete ID:18 Title:Single:LINE RACE
00:36:44,224 [main] INFO  NetServer: Logout: **ip**
00:36:44,224 [main] INFO  NetServer: Cedevita has logged out
00:36:44,224 [main] INFO  NetServer: Killed 2 dead connections
00:36:44,226 [main] INFO  NetServer: Paradox  !botJudpywY has logged in 
(Host:**ip** Team:)
00:36:44,981 [main] INFO  NetServer: Hyper Zircean !Ya.GWW5jkg has logged in 
(Host:**ip** Team:)

I will increase the timeout delay now till the issue doesnt show up anymore, 
since the server is not playable like this, as soon as someone joins others get 
dropped

let me know if you want to debug this on nullpo.it.cx, then I can change the 
settings for you

Original comment by bob.ins...@gmail.com on 5 Jan 2011 at 12:40

GoogleCodeExporter commented 8 years ago
just to note and rule out any coincidences: I also increased 
netserver.maxLobbyChatHistory and netserver.maxRoomChatHistory when I lowered 
netserver.timeoutTime

Original comment by bob.ins...@gmail.com on 5 Jan 2011 at 12:47

GoogleCodeExporter commented 8 years ago
5 seconds? That's too short.
Currently NullpoMino sends a ping message every 10 seconds. So 
random-disconnection will happen if you set the timeout below 10 seconds.
Maybe we should set ping interval to 5 or less seconds?

Original comment by pbomqlu910963@gmail.com on 5 Jan 2011 at 11:23

GoogleCodeExporter commented 8 years ago
okay, I was under the impression from the description that the timeoutTime 
value defined the ping/pong interval and that this is not hardcoded. Maybe add 
it as another config value? 5 sec makes sense to me, I have it set to 10 atm, 
and it seems to work ok. But giving this value to the server admin to control, 
is pbbly best.

Original comment by bob.ins...@gmail.com on 5 Jan 2011 at 1:08

GoogleCodeExporter commented 8 years ago
That's a good idea.
I added server-controlled Ping interval option in r618. Please try it.

Original comment by pbomqlu910963@gmail.com on 5 Jan 2011 at 2:12

GoogleCodeExporter commented 8 years ago
ok great, updated the server to r618, running with

netserver.timeoutTime=15000
netserver.clientPingInterval=5000

now for testing - looks ok so far.

Original comment by bob.ins...@gmail.com on 5 Jan 2011 at 2:38

GoogleCodeExporter commented 8 years ago

Original comment by w.kowa...@gmail.com on 21 Jan 2011 at 3:26