Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reconnect to the server? #96

Open
saikalyan9981 opened this issue May 16, 2020 · 4 comments
Open

How to reconnect to the server? #96

saikalyan9981 opened this issue May 16, 2020 · 4 comments

Comments

@saikalyan9981
Copy link
Contributor

saikalyan9981 commented May 16, 2020

Hello @mhauskn ,
I have an issue with reconnecting to the server and avoiding SERVER_DOWN.
Is it possible to reconnect to the server when it is down?
In my case after running for a few (33,000) episodes:
It's throwing error as

base_right 3: waited 5 seconds. server down??
base_right 3: finished.
base_right 3: finished.
base_right 3: finished.
base_right 3: finished.
(...)

I cannot understand why the status of HFOEnvironment() is becoming SERVER_DOWN.
I tried to increase the serverWaitSeconds to 50,
program worked perfectly for more episodes this time, but still, eventually, its status became SERVER_DOWN.

So I tried to reconnect to the server when the status is SERVER_DOWN, but it is throwing
this error:

HFO/src/strategy.cpp 198: already initialized.

Is there any workaround for my case? also any plausible explanation of why status is becoming SERVER_DOWN?

I saw an issue for the workaround of Re-starting hfo server , is it the only way I can do it or can I connect to the server multiple times?

@mhauskn
Copy link
Member

mhauskn commented May 16, 2020

Hi - a couple of thoughts - perhaps the rcssserver is dying after some time. If this is the case, you'll need to actually restart the rcssserver process before you'll be able to connect to it. Next time you observe this crash, I'd suggest looking at your processes to see if the rcssserver is still alive or not. You may also be able to find logs from the rcssserver at a path like ~/.rcssserver (memory is a bit fuzzy as to the exact path name, but these logs may help to diagnose what the cause of the server going down in the first place was).

@saikalyan9981
Copy link
Contributor Author

saikalyan9981 commented May 17, 2020

Thank you for the suggestion and quick response. Indeed you were right the rcssserver is dying after some time. Restarting the server should help (as of now I'm using serverWaitSeconds of 500 sec, and everything seems fine). But I was unable to detect the problem of the server going down. The ~/.rcssserver has these files CSVSaver.conf, player.conf, server.conf. Were you trying to suggest the .rcg, .rcl files, I couldn't extract any information of server down from them, they were normal.

@huzhejie
Copy link

huzhejie commented Jan 10, 2021

@saikalyan9981
I can not find the way to set serverWaitSeconds. I would appreciate it if you could tell me it

@saikalyan9981
Copy link
Contributor Author

@huzhejie
In HFO.cpp, config
add this line
config.set_serverWaitSeconds(500);//add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants