Server times out for loading saved games (OSX)

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Server times out for loading saved games (OSX)

#1 Post by mem359 »

I got today's test build for the Mac.
Whenever I try to load a saved game, I get a server time out.
I tried the build from last week, and got the same problem.
(The last build I had tried before that was 10 months old. I've been away...)
Using Mac OSX 10.11.6 (El Capitan, not Sierra).

In the freeorion.log file, no problem when starting (and playing) a new game:
2017-02-28 22:30:39.464001 [debug] Client : HumanClientApp.cpp:374 : HumanClientApp::StartServer: /Users/me/Applic/FreeOrion/FreeOrion.app/Contents/Executables/freeoriond
2017-02-28 22:30:39.464142 [debug] Client : HumanClientApp.cpp:404 : ai-config not set.
2017-02-28 22:30:46.865406 [debug] Client : ClientNetworking.cpp:166 : ClientNetworking::ConnectToServer : attempting to connect to server at 127.0.0.1
2017-02-28 22:30:46.865604 [debug] Client : ClientNetworking.cpp:178 : tcp::resolver::iterator host_name: 127.0.0.1 address: 127.0.0.1 port: 12346
2017-02-28 22:30:46.866036 [debug] Client : ClientNetworking.cpp:196 : ClientNetworking::ConnectToServer : connected to server
2017-02-28 22:30:46.866072 [debug] Client : ClientNetworking.cpp:198 : ClientNetworking::ConnectToServer : this client using binary serialization.
2017-02-28 22:30:46.866120 [debug] Client : ClientNetworking.cpp:203 : ClientNetworking::ConnectToServer : starting networking thread
2017-02-28 22:30:46.866214 [debug] Client : HumanClientApp.cpp:457 : HumanClientApp::NewSinglePlayerGame : Connected to server
... but at some point I need a break. And I'm unable to use the saved game, which has different results:
2017-02-28 22:36:44.785759 [debug] Client : HumanClientApp.cpp:651 : HumanClientApp::LoadSinglePlayerGame() Starting server
2017-02-28 22:36:44.785805 [debug] Client : HumanClientApp.cpp:374 : HumanClientApp::StartServer: /Users/me/Applic/FreeOrion/FreeOrion.app/Contents/Executables/freeoriond
2017-02-28 22:36:44.785838 [debug] Client : HumanClientApp.cpp:404 : ai-config not set.
2017-02-28 22:36:44.799227 [debug] Client : HumanClientApp.cpp:653 : HumanClientApp::LoadSinglePlayerGame() Server started
2017-02-28 22:36:44.799476 [debug] Client : HumanClientApp.cpp:658 : HumanClientApp::LoadSinglePlayerGame() Connecting to server
2017-02-28 22:36:44.799503 [debug] Client : ClientNetworking.cpp:166 : ClientNetworking::ConnectToServer : attempting to connect to server at 127.0.0.1
2017-02-28 22:36:44.799600 [debug] Client : ClientNetworking.cpp:178 : tcp::resolver::iterator host_name: 127.0.0.1 address: 127.0.0.1 port: 12346
2017-02-28 22:36:49.800001 [debug] Client : ClientNetworking.cpp:207 : ClientNetworking::ConnectToServer : no connection yet...
2017-02-28 22:36:49.800111 [debug] Client : ClientNetworking.cpp:211 : ClientNetworking::ConnectToServer : failed to connect to server (no exceptions)
2017-02-28 22:36:49.800139 [error] Client : HumanClientApp.cpp:662 : HumanClientApp::LoadSinglePlayerGame() server connecting timed out

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Server times out for loading saved games (OSX)

#2 Post by MatGB »

You won't be able to load ten month old savegames with a current test: basically finish any game before installing a new version, dev progress means that savegames break regularly between versions.

If you want to complete your old games then you'll need to do it with the old version, but if the current version lets you play normally, which is what I think is happening, you're good to go with the new features: several new features are only unlocked at game start or on completing a tech anyway, so even if there was compatibility between versions you'd miss out on a lot of stuff, etc.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Server times out for loading saved games (OSX)

#3 Post by mem359 »

That wasn't what I meant.
I removed all traces of the 10 month old version, including saves.

As the log file time stamp indicates, I started a new game with this version, saved it, and then was unable to load it without getting the server time-out.

I only mentioned 10 months to indicate that I don't know when this problem started happening.

There are differences between a "new game" and a "load game", just based on the extra messages being generated by HumanClientApp.cpp in the log file. But since I haven't been up to my neck in the guts of the code like the developers, I don't know what else to try to help diagnose the issue.

EDIT: I'm not sure if I'm looking at the current version of HumanClientApp.cpp,
but it looks like the "New Game" subroutine uses
448 while (!m_networking.ConnectToLocalHostServer(boost::posix_time::seconds(2))) {
while the "LoadSinglePlayerGame" subroutine uses
660 while (!m_networking.ConnectToLocalHostServer()) {
Hopefully someone else knows what the default arguments are for "ConnectToLocalHostServer", and whether that would make a significant difference.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Server times out for loading saved games (OSX)

#4 Post by MatGB »

Ah, ok, I misread. I just checked as I'm on my laptop and I've saved, quit and then reloaded the game I was playing that I started earlier, so it's not happening on Windows, beyond that it'll need someone who knows the guts better'n me (and, y'know, with a Mac).
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Server times out for loading saved games (OSX)

#5 Post by mem359 »

I looked at the freeoriond.log files for "New Game" and for "Load Game".
For both, it took about 1.8 seconds between the "Logger initialized" to "server waiting for network events".

Now I looked at the freeorion.log file.
For the new game, I can see the line "HumanClientApp::StartServer", and about 4 seconds later (2.3 seconds after the server is ready for network events), there is an attempt (successful) to ConnectToServer.


For the load game, there is a message from "HumanClientApp::LoadSinglePlayerGame()" that the server has started, only 10 msec after the "StartServer", and immediately tries to make a connection. This is 2 seconds before the server is actually ready for network events.

If someone can figure out why the "Load Game" isn't waiting 4 seconds like the "New Game" does, that will probably solve the time-out issue.

EDIT: I just tried the "New Game - Quickstart" option. It also tries to make an immediate connection to the server, well before the server is ready. The difference is, after timing out after 2 seconds, it tried a 2nd time to connect, and this time was successful.

EDITEDIT: There is a global variable SERVER_CONNECT_TIMEOUT = 4.5 seconds.
As long as this much time has not elapsed, the game will continue trying to connect to the server.

In the case of "New Game - Quickstart", since it tries every 2 seconds to make a connection, it can fail the first time and still have 2 more cracks at a connection. In the case of "Load Game", it tries every 5 seconds (the default value when no argument is given), so when it fails the first time, there is no 2nd or 3rd try.

MY SUGGESTION: In "HumanClientApp.cpp" change line 660 to be like line 448 (include the "boost::posix_time::seconds(2)" as an argument to the ConnectToLocalHostServer call).

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Server times out for loading saved games (OSX)

#6 Post by Vezzra »

@mem359, can you open a github issue about this?

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Server times out for loading saved games (OSX)

#7 Post by Vezzra »

Yep, can reproduce the issue on my Mac (OSX 10.10).

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Server times out for loading saved games (OSX)

#8 Post by mem359 »

Vezzra wrote:@mem359, can you open a github issue about this?
https://github.com/freeorion/freeorion/issues/1371

geoffthemedio has already noticed it, and added labels to categorize the problem.

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Server times out for loading saved games (OSX)

#9 Post by mem359 »

This issue is still present in the March 7th test build.

(Although it looks like LGM-Doyle committed something a few hours ago to fix this?)

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Server times out for loading saved games (OSX)

#10 Post by Vezzra »

We are still working on the fix. LGM-Doyle has already provided a PR, but there is a bug in it we haven't been able to track down yet.

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Server times out for loading saved games (OSX)

#11 Post by mem359 »

As expected from recent code changes, the most recent test build (from March 21) no longer has this problem.

LGM-Doyle
Programmer
Posts: 219
Joined: Mon Feb 29, 2016 8:37 pm

Re: Server times out for loading saved games (OSX)

#12 Post by LGM-Doyle »

mem359, thanks for the feedback confirming the fix.

Post Reply