Ctrl+C / Ctrl+Break doesn't shut the dedicated server down on Windows as of 4.15.0

In 4.12-4.13 when running a dedicated server (configuration Development_Editor, Win64) pressing Ctrl+C in the server’s console window was triggering a graceful shutdown with proper deinitialization.

In 4.15.0 nor Ctrl+C, nor Ctrl+Break does that. Without it there’s no clean way to shut a Development_Editor build of the dedicated server down on Windows.

Hey bstone,

I noticed that in 4.14 CTRL+SHIFT+C was the hotkey that initialized the server shutdown process. Can you confirm that CTRL+SHIFT+C does not work for you in 4.15?

Hello Sean,

Thanks for the reply! I was using CTRL+C prior to 4.15 but I’ll give CTRL+SHIFT+C a try after the weekend and will let you know.

So I’ve tried CTRL+SHIFT+C and looks like it cuts the engine off without shutting it down properly as well. Here’s what I see at the end of the engine log after pressing CTRL+C or CTRL+SHIFT+C:

[2017.03.06-13.32.24:503][ 0]LogWorld: Bringing up level for play took: 0.001842
[2017.03.06-13.32.24:503][ 0]LogGameMode:Display: Match State Changed from EnteringMap to WaitingToStart
[2017.03.06-13.32.24:504][ 0]LogGameState: Match State Changed from EnteringMap to WaitingToStart
[2017.03.06-13.32.24:504][ 0]LogLoad: Took 0.165170 seconds to LoadMap(/Game/Maps/stmariedumont_main)
[2017.03.06-13.32.24:506][ 0]LogOnline: GotoState: NewState: Playing
[2017.03.06-13.32.24:632][ 0]LogLoad: (Engine Initialization) Total time: 8.94 seconds
[2017.03.06-13.32.24:632][ 0]LogLoad: (Engine Initialization) Total Blueprint compile time: 0.75 seconds
[2017.03.06-13.32.24:633][ 0]LogExternalProfiler: No external profilers were discovered. External profiling features will not be available.

In 4.14 I was seeing the shutdown sequence every time I pressed CTRL+C.

Interesting, I’ve just tested this in 4.15, and CTRL+C actually initiated the shutdown process for me. Would you mind trying to run through the server creation process again in a clean project and giving this another shot?

Yeah, will do and let you know!

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

Hi Sean,

Sorry, I thought I replied about the clean server project but apparently I fooled myself. I confirm the issue in a clean project.

Furthermore that made me think it’s not the server issue but something deeper in the engine. So I launched the Rocket version of the UE4 Editor itself with the -log flag. Once I’ve got the Open Project dialog I pressed CTRL+C in the log console window and it closed the editor window but the log console itself remained stuck and I didn’t see the shutdown actions logged there; I had to kill the UE4Editor process it with the task manager and I noticed that it was producing consistent CPU load before I killed it.

I repeated the same steps with a debugger attached and here’s the call stack of the only thread that was still running after I pressed the CTRL+C:

[External Code]	

UE4Editor-Core.dll!FAsyncWriter::FlushBuffer() Line 116 C++
UE4Editor-Core.dll!FAsyncWriter::Flush() Line 223 C++
UE4Editor-Core.dll!FOutputDeviceRedirector::PanicFlushThreadedLogs() Line 109 C++
UE4Editor-Core.dll!StaticFailDebug(const wchar_t * Error, const char * File, int Line, const wchar_t * Description, bool bIsEnsure) Line 80 C++
UE4Editor-Core.dll!FDebug::LogAssertFailedMessage(const char * Expr, const char * File, int Line, const wchar_t * Format, …) Line 167 C++
UE4Editor-RenderCore.dll!FRenderResource::ReleaseResource() Line 42 C++
[External Code]
UE4Editor-PerforceSourceControl.dll!onintr(int v) Line 42 C++
[External Code]

Apparently this could be related to interaction with Perforce and maybe that’s why you couldn’t reproduce it if you tried it on with an engine copy that was never run with a Perforce connection set up.

Hope that helps!

Sorry for the delay. A colleague and I spent some time testing this yesterday, but we were unable to come to any conclusive results regarding a solid repro for the issue.

If you’d like to explicitly run me through your process with a detailed list of steps, I’d be glad to give it another shot, as it’s definitely possible that we’re overlooking something in our tests.

Thanks

Hi Sean. Thanks for your patience and attention to this issue. I’ve captured the following video for you: CTRL+C or CTRL+SHIFT+C in the log console hangs the UE4 process - YouTube

I started a just saved blank project (no source control, SteamVR plugin disabled - just to be sure those aren’t the culprit) in the UE4Editor with the -log option and pressed CTRL+C in the log console window once. That closed the editor window but left the log console window open and the editor process hanging without any way to stop it other than killing it with the task manager.

The video ends a few seconds after I pressed CTRL+C. I get the same results if I press CTRL+SHIFT+C.

A quick update: it seems I can stop the UE4 editor process after I press CTRL+C in the log console window without killing it in the task manager. I can do that by clicking the close icon of the log console window. But that still prevents the proper shutdown sequence as the last few saved log lines I see in that case are:

[2017.03.22-15.33.27:588][  1]LogCollectionManager: Rebuilt the object cache for 0 collections in 0.000004 seconds (found 0 objects)
[2017.03.22-15.33.27:590][  1]LogCollectionManager: Fixed up redirectors for 0 collections in 0.002072 seconds (updated 0 objects)
[2017.03.22-15.33.33:857][277]LogRenderer: Reallocating scene render targets to support 1032x576 NumSamples 1 (Frame:280).

Thanks for the video. So after running through that process in 4.14 and 4.15, I’m seeing the same behavior.

CTRL+C did not initiate the shutdown process for me in 4.14 or 4.15. As a result, this leads me to believe that this may not be intended to work. You’re saying that in 4.14.3, if you run that exact same repro, you get the shutdown process in the log?

Good question! I just tried that in 4.14.3 and it had the same issue - no shutdown process. Which is odd because I’ve been developing a multiplayer game with it for quite a while and I was shutting the server instances down with CTRL+C and I could see the shutdown sequence live in the log console window.

I’m completely puzzled now. Unfortunately I can’t revert the project to test it in 4.14.3 once again. I wonder if I had something in my project that made it work in 4.14.3. Can’t think of anything like that though.

Unfortunately, without a repro for the issue, we’re unable to take any further action on it at this time.

If you have time to dig into it at a later date and discover a new set of steps or more information for us, feel free to leave a comment to reopen this thread and we can reopen the investigation.

Thanks!

Understandable! Thanks for taking it that far with what’s been available.