Intermittent - services/sync/tests/unit/test_service_wipeServer.js | Test timed out when Gecko 65 merges to Beta on 2018-12-03
Categories
(Firefox :: Sync, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox63 | --- | unaffected |
firefox64 | --- | unaffected |
firefox65 | + | wontfix |
People
(Reporter: stefan_hindli, Unassigned)
References
Details
(Keywords: intermittent-failure, regression)
![]() |
||
Comment 1•7 years ago
|
||
![]() |
||
Comment 2•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Updated•7 years ago
|
Comment hidden (Intermittent Failures Robot) |
Updated•7 years ago
|
Comment hidden (Intermittent Failures Robot) |
Updated•7 years ago
|
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
•
|
||
Comment 9•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 13•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment 18•7 years ago
|
||
Did some digging into this today.
It looks like both FormHistory and Places are attempting to do some kind of maintainance keyed off of idle-daily, and for some reason, we're hitting idle-daily when we're supposed to be shutting down.
Stay tuned.
Comment hidden (Intermittent Failures Robot) |
Comment 20•7 years ago
|
||
Okay, I think I've figured out what's going on here.
When running xpcshell tests, we notify about profile shutdown stuff here:
nsIdleServiceDaily is set up to ignore idle events after profile-after-change and xpcom-shutdown is observed:
https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/widget/nsIdleService.cpp#214-218
and
https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/widget/nsIdleService.cpp#79-86
From what I can tell via logging, it looks like it's possible to instantiate an nsIdleServiceDaily after profile-after-change has been fired. Presumably, perhaps while spinning the event loop inside AsyncShutdown.jsm, something is creating an nsIdleService (which creates and inits an nsIdleServiceDaily), which never unregisters itself because it's past the point where it normally does that (the point where profile-after-change fires).
The idle-daily fires not long after the service inits, and that causes things like the FormHistory expiries and Places maintenance stuff to kick off, which opens up the databases. And at that point, the AsyncShutdown.jsm stuff has gone past the profile-before-change notification where Sqlite.jsm normally closes those database handles.
This is all a bit hand-wavey because I can only reproduce this on try, and I'm doing analysis with logging. And even then, the error case is hit irregularly.
So it's a bit of a cluster. I think what we probably want to do here is prevent the nsIdleService and nsIdleServiceDaily from running any observers if we're in the midst of shutting down.
I'll try to post a patch that does that.
Comment 22•7 years ago
|
||
Just so more notes here:
I actually think the idle service stuff is a symptom of a larger problem. Even if I disable the idle service, the test will still fail periodically because some sync stuff fires up and fails when registering AsyncShutdown stuff.
As far as I can tell, this is happening because:
- Sync's service.js runs this.Service.onStartup() anytime it's imported, including in xpcshell tests like test_load_modules.js
- test_load_modules.js runs synchronously, and doesn't wait for this.Service.onStartup() to finish its work before exiting. So the xpcshell framework goes, "oh, I guess this test is done now", and starts to tear down the fake profile. This causes the profile-before-change, profile-foo-teardown, xpcom-shutdown observer notifications to fire
- Then, sometimes, onStartup reaches the point in engine registration where it attempts to do stuff with AsyncShutdown.jsm - but by that point, it's too late because the observer notifications it cares about have already fired, so AsyncShutdown throws exceptions
And I think that causes everything to just kinda wait for a bit. Eventually the idle service kicks off, and that adds even more console spew because we're right at the edge of shutting down, and the idle-daily stuff also tries to access db things
So this is a classic race - the race between xpcshell shutting itself down, and sync starting itself up. Often times, it seems Sync gets itself started up first, and that's when we're all green. It's when Sync loses that race where things go sideways.
Lina, am I okay to hand this over to you now?
Comment 23•7 years ago
|
||
(In reply to Mike Conley (:mconley) (:⚙️) from comment #22)
- test_load_modules.js runs synchronously, and doesn't wait for this.Service.onStartup() to finish its work before exiting. So the xpcshell framework goes, "oh, I guess this test is done now", and starts to tear down the fake profile. This causes the profile-before-change, profile-foo-teardown, xpcom-shutdown observer notifications to fire
Ouch - nice sleuthing Mike! I guess in theory this isn't limited to test_load_modules, but if that's the actual problem we should either just kill this test entirely (I don't think it adds much value TBH - if this test fails but another test doesn't we've got a big gap in our test coverage), or remove service.js from the list of modules it imports (as a failure to import that will definitely cause the vast majority of our tests to fail)
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 26•6 years ago
|
||
Not sure what happened here, but it's too late to do anything for 65 at this point :(
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
![]() |
||
Comment 32•6 years ago
|
||
Not seen for 2 months.
Comment 33•6 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Updated•6 years ago
|
Description
•