Server process exited without calling ProcessEnding()

0

Hi there. So I've been trying to track down this issue over time through experimentation without much to show for it. My theory is that there is some subtlety to the order or timing of server API calls related to shutting down that I'm missing. I'm using the .Net Server SDK within Unity 5.6.6f2.

On Linux instances I see:

SERVER_PROCESS_CRASHED - Server process exited without calling ProcessEnding(), exitCode(137)

On Windows I see:

SERVER_PROCESS_FORCE_TERMINATED - Server process did not cleanly exit within 30 seconds of OnProcessTerminate(), exitCode(-1)

In my logs from the server instances I see output from my call to GameLiftServerAPI.ProcessEnding() followed by my call to GameLiftServerAPI.Destroy(). I then call Unity's Application.Quit() method to attempt to cleanly shutdown and upon Unity's OnApplicationQuit event handlers firing I then attempt to set the exit code via System.Environment.Exit( 0 ). I suspect my attempt to use Unity's quit functionality in conjunction with System.Environment.Exit( 0 ) may be a questionable approach but regardless I find the Linux instance's fleet event stating that ProcessEnding() was not called puzzling. Thoughts? Thanks!

posta 6 anni fa353 visualizzazioni
17 Risposte
0

Hi @REDACTEDUSER

Thanks,

Ben

con risposta 6 anni fa
0

Sure thing. Fleet fleet-******

con risposta 6 anni fa
0

Were you able to view that fleet? Any thoughts or insights are appreciated.

con risposta 6 anni fa
0

So this will sound bad...but I don't actually have access to a Linux environment to try it locally (relying on the beautiful cross platform dream of Unity). However, I have run a Windows version of my server and verified its error code (cmd %errorlevel%) to be 0. That wasn't running GameLift local though. I'll try that as soon as I get a moment.

I'm definitely supposed to be calling the GameLift Destroy API before I exit, right?

con risposta 6 anni fa
0

Hi @REDACTEDUSER

Process shutdown with exit code: 137

Can you try shutting down locally to see if you're getting the same exit code?

Thanks,

Ben

con risposta 6 anni fa
0

Hey there. Finally got a chance to run my server against GameLift Local again. It's under Windows and not Linux like I'm running in live but still interesting. It looks like GameLift Local is actually throw exceptions...and in doing so possibly preventing my server process from ending? Any thoughts?

7505-gamelift-local-log.txt|attachment (17.8 KB)gamelift-local-log.txt

con risposta 6 anni fa
0

Hi @REDACTEDUSER

I'm looking into this now and hope to have an answer for you soon.

con risposta 6 anni fa
0

Much appreciated!

con risposta 6 anni fa
0

Hi @REDACTEDUSER

con risposta 6 anni fa
0

Hi @REDACTEDUSER

con risposta 6 anni fa
0

Has this been resolved? I've updated to the latest server SDK for .NET 4.5 but I'm running into the same issue.

con risposta 5 anni fa
0

I'm seeing this issue about every 5 minutes in the event logs.. Is this something others are seeing? I've run my game server locally on windows without issues for multiple hours so I'm not sure why that would be happening...

con risposta 5 anni fa
0

If you are calling ProcessEnding and then calling Destroy there appears to be a race condition that can cause your process to be incorrectly marked as crashed.

Short term fix is to avoid that call to Destroy. A fix is in the works, but no ETA at this time.

con risposta 5 anni fa
0

Hi, I have same issue and avoiding calling Destroy doesn't help me. My server process log says ProcessEnding() is succssfully called but fleet event log shows "Server process exited without calling ProcessEnding(), exitCode(137)". In local gamelift, exit code is 0. Is there any solution for this?

(Unity 2019.1, GameLift Server SDK 3.3.0.)

con risposta 5 anni fa
0

I found the example in Unity says to call:

void OnApplicationQuit()
{
    // Make sure to call GameLiftServerAPI.Destroy() when the application quits,
    // this resets the local connection with GameLift's agent.
    if(!m_ProcessEnding)
        GameLiftServerAPI.Destroy();
}

If you just remove this bit of code, seems to terminate without errors

con risposta 4 anni fa
0

On second review, still did not end cleanly...

I found this was an issue with the build not exiting without errors (my bad), then after you have called, and got an ok from:

GameLiftServerAPI.ProcessEnding();

In Unity you need to call:

Application.Quit();

Failure to do this may result in both a SERVER_PROCESS_FORCE_TERMINATED Server process did not cleanly exit within 30 seconds of OnProcessTerminate() or a SERVER_PROCESS_TERMINATED_UNHEALTHY Server process exceeded 3 minutes without reporting healthy message

con risposta 4 anni fa
0

Thanks for the updates. Both your posts are correct:

Thanks for the update.

con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande