Doesn't SIGSEGV execute preStop?

70 views Asked by At

I'm developing a game service on ubuntu 20.04 with an unreal dedicated server on agones environment.

I'm working on adding preStop to the fleet on agones to upload logs to a fileserver when the ds is crashed.

When I directly access the pod on the EKS(AWS K8s service) environment and kill the pod with kill -15 {pid}, preStop runs correctly. However, when I kill the pod with kill -11 {pid}, preStop does not run.

The app I'm building has a high probability of getting -11 (segmentation error). I need preStop to fire on -11 (segmentation error) as well as -5 (sigterm).

Is it correct that preStop is not executed for segmentation error?

Thanks.

kill -15 {pid} log

2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: Worker 0 finished with status 0
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down output plugin type=:stdout plugin_id="object:820"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down output plugin type=:prometheus plugin_id="object:80c"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down output plugin type=:copy plugin_id="object:7f8"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down input plugin type=:prometheus_output_monitor plugin_id="object:870"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down input plugin type=:prometheus plugin_id="object:85c"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down input plugin type=:tail plugin_id="object:848"
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 shutting down fluentd worker worker=0
2023-09-25 18:12:06 
2023-09-25 09:12:06 +0000 [info]: #0 fluentd worker is now stopping worker=0
2023-09-25 18:12:05 
Exiting abnormally (error code: 143)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:814][558]LogCore: FUnixPlatformMisc::RequestExit(bForce=false, ReturnCode=143)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:814][558]LogExit: Exiting.
2023-09-25 18:12:05 
[2023.09.25-09.12.05:813][558]LogModuleManager: Shutting down and abandoning module RSA (3)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogModuleManager: Shutting down and abandoning module SunPosition (377)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogNIS: ShutdownModule Leave
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogNIS: ShutdownModule Enter
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogModuleManager: Shutting down and abandoning module NISCore (379)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogModuleManager: Shutting down and abandoning module StreamlineBlueprint (381)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogModuleManager: Shutting down and abandoning module NavigationSystem (384)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogModuleManager: Shutting down and abandoning module AIModule (385)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:766][558]LogExit: Object subsystem successfully closed.
2023-09-25 18:12:05 
[2023.09.25-09.12.05:676][558]LogExit: Game engine shut down
2023-09-25 18:12:05 
[2023.09.25-09.12.05:675][558]LogDemo: Cleaned up 0 splitscreen connections, owner deletion: enabled
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogExit: Preparing to exit.
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogGameFeatures: Shutting down game features subsystem
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogWorld: UWorld::CleanupWorld for Test_TDM, bSessionEnded=true, bCleanupResources=true
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogWorld: UWorld::CleanupWorld for Test_TDM, bSessionEnded=true, bCleanupResources=true
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogContentBundle: [Test_TDM(Dedicated Server)] Deleting container.
2023-09-25 18:12:05 
[2023.09.25-09.12.05:647][558]LogWorldPartition: UWorldPartitionStreamingPolicy: CellsToActivate(0), CellsToLoad(0), CellsToUnload(3)
2023-09-25 18:12:05 
[2023.09.25-09.12.05:646][558]LogWorld: UWorld::CleanupWorld for Test_TDM, bSessionEnded=true, bCleanupResources=true
2023-09-25 18:12:05 
[2023.09.25-09.12.05:146][558]LogExit: GameNetDriver IpNetDriver_2147481945 shut down
2023-09-25 18:12:05 
[2023.09.25-09.12.05:146][558]LogNet: DestroyNamedNetDriver IpNetDriver_2147481945 [GameNetDriver]
2023-09-25 18:12:05 
[2023.09.25-09.12.05:146][558]LogNet: World NetDriver shutdown IpNetDriver_2147481945 [GameNetDriver]
2023-09-25 18:12:05 
[2023.09.25-09.12.05:145][558]LogInit: Display: PreExit Game.
2023-09-25 18:12:05 
[2023.09.25-09.12.05:145][558]LogCore: Engine exit requested (reason: EngineExit() was called; note: exit was already requested)
2023-09-25 18:12:05 
_219:7135:458332982378564608"  source: "ds:3_38_168_219:7135:458332982378564608"  target: "configserver"  expiration: "30000"  version: 94439}request {  auth_token: "NDA1MjI3YzMtZDQ4Yi00NDA3LWEyMzYtYWM2NWRjNzNiZDli"}lease_id: 5590245612951753133node_id: 1280
2023-09-25 18:12:05 
preStop hook 7 #### preStop get executed!!
2023-09-25 18:12:05 
preStop hook 2 #### preStop get executed!!
2023-09-25 18:12:05 
preStop hook 1 #### preStop get executed!!
2023-09-25 18:12:05 
{"error":"http: Server closed","message":"http server closed","severity":"info","source":"main","time":"2023-09-25T09:12:05.299543218Z"}
2023-09-25 18:12:05 
{"error":"http: Server closed","gsKey":"owserver-ds/owserver-apps-ds-ncbj9-rd9fc","message":"Health check: http server closed","severity":"error","source":"*sdkserver.SDKServer","time":"2023-09-25T09:12:05.299565475Z"}
2023-09-25 18:12:05 
{"gsKey":"owserver-ds/owserver-apps-ds-ncbj9-rd9fc","message":"...shutting down workers","queue":"agones.dev.owserver-ds.owserver-apps-ds-ncbj9-rd9fc","severity":"info","source":"*sdkserver.SDKServer","time":"2023-09-25T09:12:05.29952406Z"}
2023-09-25 18:12:05 
{"message":"Shutting down SDK server","severity":"info","source":"main","time":"2023-09-25T09:12:05.299496263Z"}
2023-09-25 18:12:05 
{"gsKey":"owserver-ds/owserver-apps-ds-ncbj9-rd9fc","message":"SDK server shutdown requested, waiting for game server shutdown","severity":"info","source":"*sdkserver.SDKServer","state":"Shutdown","time":"2023-09-25T09:12:05.299453587Z"}
2023-09-25 18:12:05 
2023-09-25 09:12:05 +0000 [info]: Received graceful stop

kill -11 {pid} log

2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: Worker 0 finished with status 0
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down output plugin type=:stdout plugin_id="object:820"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down output plugin type=:prometheus plugin_id="object:80c"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down output plugin type=:copy plugin_id="object:7f8"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down input plugin type=:prometheus_output_monitor plugin_id="object:870"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down input plugin type=:prometheus plugin_id="object:85c"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down input plugin type=:tail plugin_id="object:848"
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 shutting down fluentd worker worker=0
2023-09-25 18:05:36 
2023-09-25 09:05:36 +0000 [info]: #0 fluentd worker is now stopping worker=0
2023-09-25 18:05:35 
2023-09-25 09:05:35 +0000 [info]: Received graceful stop
2023-09-25 18:05:35 
{"error":"http: Server closed","gsKey":"owserver-ds/owserver-apps-ds-ncbj9-fnzj5","message":"Health check: http server closed","severity":"error","source":"*sdkserver.SDKServer","time":"2023-09-25T09:05:35.505460436Z"}
2023-09-25 18:05:35 
{"error":"http: Server closed","message":"http server closed","severity":"info","source":"main","time":"2023-09-25T09:05:35.505443404Z"}
2023-09-25 18:05:35 
{"message":"Shutting down SDK server","severity":"info","source":"main","time":"2023-09-25T09:05:35.505382401Z"}
2023-09-25 18:05:35 
{"gsKey":"owserver-ds/owserver-apps-ds-ncbj9-fnzj5","message":"...shutting down workers","queue":"agones.dev.owserver-ds.owserver-apps-ds-ncbj9-fnzj5","severity":"info","source":"*sdkserver.SDKServer","time":"2023-09-25T09:05:35.505384415Z"}
2023-09-25 18:05:35 
{"gsKey":"owserver-ds/owserver-apps-ds-ncbj9-fnzj5","message":"SDK server shutdown requested, waiting for game server shutdown","severity":"info","source":"*sdkserver.SDKServer","state":"RequestReady","time":"2023-09-25T09:05:35.505220346Z"}
2023-09-25 18:05:26 
Segmentation fault (core dumped)
2023-09-25 18:05:26 
Engine crash handling finished; re-raising signal 11 for the default handler. Good bye.
2023-09-25 18:05:26 
[2023.09.25-09.05.26:026][345]LogHAL: Error: FUnixPlatformProcess::CreateProc: File does not exist (/app/Engine/Binaries/Linux/CrashReportClient)
2023-09-25 18:05:26 
[2023.09.25-09.05.26:011][345]LogExit: Executing StaticShutdownAfterError
0

There are 0 answers