Server process exited without calling ProcessEnding() though we call ProcessEnding()

Hello!

We are trying to terminate the game server after each session so we are calling ProcessEnding instead of TerminateGameSession and right after that we kill server process. Despite this we are getting the error in fleet’s events tab that server process crashed without calling ProcessEnding. Why?

We are using Unity3D running on Linux. Perhaps ProcessEnding is not synchronous and we should wait some time before killing the process?

That’s the actual code:

    public void TerminateSession() {
GameLiftServerAPI.ProcessEnding();
System.Diagnostics.Process.GetCurrentProcess().Kill();
}

We’ve made one more test with wating 10 seconds after ProcessEnding and killing process only after that. But it didn’t help.

You should ideally wait for the response of ProcessEnding before terminating the process:

https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk-csharp-ref-actions.html

Do you see a success response?