[haiku-development] Re: Has the shutdown process changed recently?

  • From: "Máximo Castañeda" <dmarc-noreply@xxxxxxxxxxxxx> ("antiswen")
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 1 Nov 2022 18:34:20 +0000 (UTC)

 En martes, 1 de noviembre de 2022, 14:57:38 CET, Humdinger 
<dmarc-noreply@xxxxxxxxxxxxx> escribió: 

I found out what has changed that Clipdinger doesn't save its history any more:
To avoid an entry in Deskbar's running apps list, and since Clipdinger is a 
sort of invisible system service, it 
has set its "Background app" flag with the last update.
Removing that flag will have Clipdinger save its history once more.

So the question changes to: How differs the shutdown messaging for background 
applications?
How to make sure Clipdinger's QuitRequested() functions are called on shutdown?


Reading ShutdownProcess, it seems non-background apps are sent the quit request 
one by one, while waiting for them or a timeout to finish.

Background apps though, are sent the request all at once and the only wait I 
see is for debugged teams before going on to the next phase, which sends a TERM 
signal to everything not in the vital apps list. Only then does it wait for the 
background apps before sending the KILL signal.

So maybe the quit message does not get to the app before the SIGTERM or is not 
processed fast enough, considering there's file writing. Maybe there should be 
another
    _ScheduleTimeoutEvent(kBackgroundAppQuitTimeout, -1);
    _WaitForBackgroundApps();
while in BACKGROUND_APP_TERMINATION_PHASE to give them some slack before firing 
signals around?


Other related posts: