Instabilities when using IPv6 with relay server

Bug #1777845 reported by Klaus Halfmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

When recording my Youtube Videso, I found that there are some instability with the Relay Server:
* I started and Internat game "HasiTube" but when connecting the next time it still was active?
* I sent the computer to conserve power mode OSX, After that I had some trouble to reconect
* I had to swutch of IPV6 in the end to allow me to connect the normal way.

Some messages from the logs:
-- 1st try:

InternetGaming: Connecting to the metaserver.
Could not resolve network name: resolve: Host not found (authoritative)
[NetClient]: Trying to connect to 85.214.243.231:7395 ... success.
InternetGaming: Sending login request.
InternetGaming: Client Hasi50 logged in.
InternetGaming: Server time offset is 0 second(s).
InternetGaming: Client update on metaserver.
InternetGaming: Received a client list update with 14 items.
InternetGaming: Received a game list update with 2 items.
InternetGaming: Client opened a game with the name HasiTube3.
InternetGaming: Game update on metaserver.
InternetGaming: Received ips of the relay to host: 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40 85.214.243.231.
InternetGaming: Client update on metaserver.
[Host]: starting up.
[NetRelayConnection] Trying to connect to 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40:7397 ... ^Cfailed.
[NetRelayConnection] Trying to connect to 85.214.243.231:7397 ... success.
[NetRelayConnection] Error when trying to receive some data: End of file.
[NetRelayConnection] Closing network socket connected to 85.214.243.231:7397.
InternetGaming: logout(SERVER_CRASHED)
[NetClient] Closing network socket connected to 85.214.243.231:7395.

-- 2nd try:

InternetGaming: Connecting to the metaserver.
Could not resolve network name: resolve: Host not found (authoritative)
[NetClient]: Trying to connect to 85.214.243.231:7395 ... success.
InternetGaming: Received ips of the relay to host: 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40 85.214.243.231.
InternetGaming: Client update on metaserver.
[Host]: starting up.
[NetRelayConnection] Trying to connect to 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40:7397 ... failed.

-- Switched to IPv4 only:

[NetRelayConnection] Trying to connect to 85.214.243.231:7397 ... success.
[NetRelayConnection] Closing network socket connected to 85.214.243.231:7397.

May that mix of IPv4/6 resulted in confusion, may the relay server
already had crashed on the IPv6 conection?

Can someone collect the server logs from today?

Notabilis (notabilis27)
Changed in widelands:
assignee: nobody → Notabilis (notabilis27)
milestone: none → build20-rc1
status: New → Confirmed
Revision history for this message
Notabilis (notabilis27) wrote :

Thanks for reporting and for the logs! I also got the ones from the server.
I guess (not sure) that the IPv6-problems and the old games might be separate bugs, but I have to look into it.

1) When you sent your computer to conserve power mode, was Widelands still connected to the metaserver when doing so?
2) Does IPv6 in Widelands normally work for you or is it always broken?
3) Does IPv6 work on your system for other servers?
4) If it never works for Widelands, does that mean that you always have to wait some time while the game tries to connect to the metaserver / the relay? It shouldn't hang for much more than a second.
If IPv6 normally works and was only behaving strange this time, you could try again. I restarted the meta-/relay-server so from the server side it should work as normal now.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Video ist https://youtu.be/5HnFbJft_qQ

Here my Answers

1) yes
2) Not sure, I was playing on bzr8534[bug-1732765-economy-refactoring] but this
   should not affect the server? (as IPv4 was OK)
3) https://[2a02:2e0:3fe:1001:7777:772e:2:85] (which is heise.de) does not work
   http://[2a02:2e0:3fe:1001:7777:772e:2:85]/ does not work either.
   Both show just an empty page
   It woks however if I switch to IPv6 only
4) Lets try, Works with Pv6 only for now, I wll send this comment now before doing more tests

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Hey, launchpad work with IPv6 only, too.

A shot nap in powsaving mode did not break it,
I assume I must make it sleep long so the connection times out?

In mixed mode widelands stll used IPv6 which is OK.

Maybe the server was broken already before I connected?

I will try a long sleep period, later

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

How to reproduce:
* Open a network game (against an I) and put it to pause
* Put computer to sleep, wait perhaps 10 minutes
* After wainking up The server is borken and the game still exists
  (Did this with HasiMixedIP just a minute ago=

logs show:
...
InternetGaming: Client opened a game with the name HasiMixedIP.
InternetGaming: Game update on metaserver.
InternetGaming: Received ips of the relay to host: 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40 85.214.243.231.
InternetGaming: Client update on metaserver.
[Host]: starting up.
[NetRelayConnection] Trying to connect to 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40:7397 ... success.
InternetGaming: Received a game list update with 1 items.
...
InternetGaming: Connecting to the metaserver.
Could not resolve network name: resolve: Host not found (authoritative)
InternetGaming: Sending login request.
[NetClient] Error when trying to receive some data: Connection reset by peer.
[NetClient] Closing network socket.
InternetGaming: Error: The connection to the metaserver was lost.
InternetGaming: Connecting to the metaserver.
Could not resolve network name: resolve: Host not found (authoritative)
[NetClient]: Trying to connect to 85.214.243.231:7395 ... success.
InternetGaming: Sending login request.
InternetGaming: Client Hasi501 logged in.
InternetGaming: Server time offset is 1 second(s).
InternetGaming: Client update on metaserver.
InternetGaming: Reconnected to metaserver
InternetGaming: Reconnected to metaserver
InternetGaming: Received a client list update with 13 items.
InternetGaming: Received a game list update with 1 items.
InternetGaming: Client announced the disconnect from the game HasiMixedIP.
lastserial: 0
[NetRelayConnection] Closing network socket connected to 2a01:238:4326:5100:b5ce:5c0b:f1f4:2e40:7397.

mabe after waking up the DNS on OSX is not yet fully awake?

Revision history for this message
Notabilis (notabilis27) wrote :

Thanks a lot for testing! This should make debugging a lot easier.

"Could not resolve network name: resolve: Host not found (authoritative)" indeed sounds as if the DNS is not immediately working. But I guess players who send their system to sleep in the middle of a game aren't that frequent. Or do you think we should try and fix that?

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Fixing this on the client side may not be possible,
so the gabe should be aborted there (with a panic savegame).

The Server however should not accumulate "broken" games,
but kill them after some kind of session timeout (say 20
minutes).

Maybe I have time to check this with a debugger, later.

Revision history for this message
Notabilis (notabilis27) wrote :

I deployed a possibly fixed version of the metaserver. Disconnected games should be removed after 5 minutes. Can you please test whether it is working correctly?

Aborting the game at the host when losing the connection is an old issue unrelated to the relay. Even before the host did not cared about lost clients and silently replaced them with AIs. In a "1 human" multiplayer game it probably doesn't really matters when the relay connection is lost anyway. For games with more humans, some kind of dialog should be displayed, though. I think there is a bug report for it somewhere but I wasn't able to find it right now.

Revision history for this message
GunChleoc (gunchleoc) wrote :
tags: added: network
tags: added: multiplayer
Revision history for this message
Notabilis (notabilis27) wrote :

Have there been any further problems in the last month after a (probable) fix was applied? If not, I think this bug can be marked as fixed.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Hmm, I think there was some improvement, so we can close this one.

Toni, if you read this: we migth try an IPv6 / IPv4 mixed test run these days?
As we both have iOS we might check this.

I have no idea how this might behave on Windows or Linux, though

Notabilis (notabilis27)
Changed in widelands:
assignee: Notabilis (notabilis27) → nobody
status: Confirmed → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.