Mojo embedded services on UI thread are not destroyed at shutdown |
||
Issue descriptionI think they are leaked. I was working on ui::ws2::WindowService and trying to figure out when embedded services are torn down so I did this: 1. Add logging to the constructors of identity::IdentityService and chromeos::MultiDeviceSetupService. Add CHECK(false) to their destructors. 2. Build target_os=chromeos. 3. Run chrome --user-data-dir=foo --enable-features=EnableUnifiedMultiDeviceSetup 4. Hit Ctrl-Shift-Q twice to quit. You'll see the constructors run but not the destructors. I tried this with FileService and I *do* see it being torn down. However, FileService runs on the IO thread. Ken, is this a real problem or am I missing something?
,
May 9 2018
James is correct; they're guaranteed to be shut down only if run on the IO thread. See this thread: https://groups.google.com/a/chromium.org/forum/#!topic/services-dev/orJmSM0Bb-E. Note that in that thread I produced a proposal for this problem, but I never implemented it.
,
May 9 2018
+sky just FYI If the design decision is that embedded services leak at shutdown, that's fine with me, I just didn't know that and was surprised.
,
May 11 2018
Personally I think that it's incongruous that embedded services are shut down if they're run on the IO thread but not otherwise. It makes more sense from my POV to either (a) just leak all embedded services and be very clear about that, or (b) leak embedded services by default but provide a mechanism for services to specify that they should be shut down (this is similar to the proposal we ended up at on the email thread IIRC). However, I don't have any cycles to make changes here, so these are just like, my opinions, man.
,
May 14 2018
I don't think we want to adopt a policy of leaking by default in the browser process, since it can pretty easily mask real leaks. As discussed in the thread you linked, the process simply shouldn't shut down until all its embedded services have quit on their own volition. Because we are far from living in that world however, it seems reasonable to allow embedded services to force their quit tasks to block shutdown as you suggested.
,
Oct 17
|
||
►
Sign in to add a comment |
||
Comment 1 by khorimoto@chromium.org
, May 9 2018