pickaxe-club / wither

Slack to Minecraft chat gateway
http://pickaxe.club
Other
26 stars 2 forks source link

Process timeout when the Minecraft server is not up. #28

Open slothbear opened 4 years ago

slothbear commented 4 years ago

Issue the command wither boot. It eventually succeeds, but not before timing out with some communication to the previous server IP address.

Errno::ETIMEDOUT - Connection timed out - connect(2) for "165.22.32.143" port 25575:
slothbear commented 4 years ago

I've been watching the timeouts for a while. I think they're happening whenever we say something in chat, wither tries to send it to RCON on the Minecraft server, and the server's not there. But,

I was confused because the messages and behavior would differ from week to week, day to day. Sometimes the command would fail immediately, other times would wait, for something, then eventually fail. I think the difference depends on what happened to the IP address the Minecraft server was using. Sometimes there is nothing at the address. Other times Digital Ocean (or other) has assigned the IP address to some other server.

Conclusion: the config var RCON_IP is bad data after the server has shutdown. I'm planning to either remove that config var (or set it to some "N/A" value so the var still exists). The unset can happen during wither shutdown since I already have a function for setting config vars (used in the new wither boot <week_number> command).

Then add a check for a real RCON_IP destination before using that IP to send chat messages to the Minecraft server.