Page 1 of 1

[0.17.74] Hang on SIGTERM during startup.

Posted: Mon Oct 28, 2019 10:21 pm
by Hornwitser
I have a unit test that send SIGTERM to the Linux headless server upon receiving the following message on stdout

Code: Select all

RemoteCommandProcessor.cpp:131: updateTick(0) changing state from(CreatingGame) to(InGame)
When running this test on Travis-CI it ocasionaly hangs instead of initiating the shutdown causing the test to fail.

The process is spawned with following parameters (where the ports and password are randomly generated)

Code: Select all

factorio/bin/x64/factorio --config test/temp/integration/config.ini --start-server-load-scenario test_scenario --port 64808 --rcon-port 62353 --rcon-password <...>
test scenario_contains only a control.lua file with following code

Code: Select all

script.on_init(function() print('test_scenario init') end)
and config.ini contains read and write data directories:

Code: Select all

[path]
read-data=factorio/data
write-data=test/temp/integration
There's nothing printed out on stdout when the server hangs. I added code to send a second SIGTERM if the factorio server hangs like this and what happened then was that it printed "Received SIGTERM, shutting down" in response to it but still stayed hanged. You can see an example of this behavior in this test result. At the very bottom is the output from the test that failed (apologies for it being difficult to read, it's parsed.)

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Tue Oct 29, 2019 10:46 pm
by movax20h
Do this happen with 0.17.73 or 0.17.72 too?

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Wed Oct 30, 2019 12:00 am
by Hornwitser
I have seen this happen on 0.17.73.

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Sat Nov 02, 2019 8:35 am
by Klonan
Can you provide a log file?

Does it happen on 0.17.74?

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Sat Nov 02, 2019 10:41 am
by Hornwitser
The linked test log shows the log outputted on stdout, though in a somewhat unreadable form. If there's something else outputed to factorio-current.log then that has been lost (do tell me if there's anything of interest there and I'll dump it too for the next time it happens.) It also shows it's running on Factorio 0.17.74 (build 47523, linux64, headless).

I saw a simmilar issue occur on a modded server running in a virtual machine. But there it didn't even print out the "Received SIGINT, shutting down" message, I've attached the log for it, but it just ends, systemd killed it after a timeout.

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Thu Nov 28, 2019 11:36 pm
by Rseding91
Thanks for the report however without a way to reproduce this there's nothing we can do.

My best guess is it's some issue specific to your system otherwise we would have more people here complaining that there's an issue with the game crashing.

Sorry.

Re: [0.17.74] Hang on SIGTERM during startup.

Posted: Fri Nov 29, 2019 11:15 pm
by Hornwitser
Still happens on a semi regular basis on 0.17.79. It would be easy to add code that for example dumps a back trace of all threads when this is detected to happen.