Open Bug 1697745 Opened 3 years ago Updated 4 months ago

Merge ClearOnShutdown with AppShutdown and generalize it to ProcessShutdown

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

People

(Reporter: jstutte, Unassigned)

References

Details

(Keywords: leave-open)

Attachments

(2 obsolete files)

This is a follow up from bug 1696397.

AppShutdown and ClearOnShutdown provide functions useful not only for the main process's shutdown. This bug proposes to:

  1. Generalize AppShutdown naming to become ProcessShutdown. This would include the renaming of some shutdown phases.
  2. Merge the few functions of ClearOnShutdown with ProcessShutdown in order to share the same shutdown state variable.
  3. Replace the static mapping of notification messages to shutdown phases with an initialization (yet to be defined) to be done by each process at startup time.

The overall goal would be to make shutdown phases something different and more fundamental for XPCOM than the associated notification messages, which should be a loose coupling for clients only.

See Also: → 1696397
See Also: → 1750635
See Also: → 1762840
See Also: → 1766572
Keywords: leave-open
Assignee: nobody → jstutte
Status: NEW → ASSIGNED

AppShutdown::AdvanceShutdownPhase tried to preserved the original order we had historically in XPCOMShutdown. This resulted in having called KillClearOnShutdown before we tried fast shutdown and/or notified our observers.
It seems desirable to remove the objects associated via ClearOnShutdown(aPhase) as last operation here, such that:

  • fast shutdown can just override their (then useless) deletion
  • otherwise notified observers can rely on them to still exist when executed

Depends on D145082

Comment on attachment 9274429 [details]
Bug 1697745: Part 1 - Remove obsolete ShutdownPhase::XPCOMShutdownLoaders. r?#xpcom-reviewers

Revision D145082 was moved to bug 1766572. Setting attachment 9274429 [details] to obsolete.

Attachment #9274429 - Attachment is obsolete: true

Comment on attachment 9274430 [details]
Bug 1697745: Part 2 - Run KillClearOnShutdown only after having notified observers in AdvanceShutdownPhase. r?#xpcom-reviewers

Revision D145083 was moved to bug 1766572. Setting attachment 9274430 [details] to obsolete.

Attachment #9274430 - Attachment is obsolete: true

Sorry for the attachment-noise here.

Once bug 1766572 landed we will have a better synchronization between the two phases, but the original scope of unifying AppShutdown and ClearOnShutdown remains valid.

Depends on: 1766572
See Also: 1766572

(In reply to Jens Stutte [:jstutte] from comment #5)

Once bug 1766572 landed we will have a better synchronization between the two phases, but the original scope of unifying AppShutdown and ClearOnShutdown remains valid.

The scope remains valid, but I will not get to it very soon, thus unassigning for now.

Assignee: jstutte → nobody
Status: ASSIGNED → NEW

The leave-open keyword is there and there is no activity for 6 months.
:nika, maybe it's time to close this bug?
For more information, please visit auto_nag documentation.

Flags: needinfo?(nika)

:jstutte do you still want to do something in this area, or can we close this bug out?

Flags: needinfo?(nika) → needinfo?(jstutte)

I definitely would want to find the time to do something on bug 1762840, and only after that look at this, so let's keep it for now.

Flags: needinfo?(jstutte)
See Also: → 1760855
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: