Ehsan Akhgari wrote: > On 2013-05-15 5:18 PM, Vladan Djeric wrote: > > I'd like to know if these use-cases are sufficiently rare that we > > should just add new shutdown events when needed (e.g. we added > > "profile-before-change2" for Telemetry in bug 844331), or if we > > should come up with a general way to impose order of shutdown > > based on dependencies? > > Do you have use cases besides these two?
Many things (and an increasing number) depend on PSM/NSS and the PSM team (a long time ago) implemented its own shutdown event registration scheme (nsNSSShutDownObject in nsNSSShutDown.h). There seems like there is at least one race due to NSS being shut down while things are still using NSS which is causing a crash or worse (presumably because there is not enough awareness of the need to implement nsNSSShutDownObject and/or it is too error-prone to do so). Also, NSS must be shut down in profile-before-change because it may write to the profile directory. So, basically the nsNSSShutDownObject scheme is a variant of the "explicit dependencies" scheme and, not a very successful one. Perhaps there are other variants of explicit dependency schemes that would be less error prone, but I am skeptical. In general, generic dependency schemes of the "upstart" variety seem like very complicated solutions, considering we have global knowledge of all the components of Firefox that we could just hard-code in, if we can assume that addons do not affect the ordering. Cheers, Brian _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform