Page MenuHomePhabricator

Exception in load-callback for schema.SaveTiming: "ext.navigationTiming.rumSpeedIndex" not loaded
Closed, ResolvedPublic

Description

Noticed this warning in the console on test.wikipedia.org (after saving an edit) while testing a patch for T193570 (probably unrelated).

Exception in load-callback in module schema.SaveTiming:
> Error: Module "ext.navigationTiming.rumSpeedIndex" is not loaded.
    at require (load.php?...:171)
    at getPaintTiming (<anonymous>:206:555)
    at getNavTiming (<anonymous>:207:578)
    at emitSaveTiming (<anonymous>:209:709)

Looks like we forgot about the second call-path to getNavTiming() when adding rumSpeedIndex, namely from emitSaveTiming, which while being called after the load starts for preloadedModules, does not wait for it (and shouldn't need to)

Its report rate hasn't changed significantly, but then again, wmf.2 is only on group0 still right now (test wikis). It probably wont' affect everybody though, it depends a particular cache state, in which the unrelated load for preloadedModules remains unresolved (cache miss or some version change), but schema.SaveTiming is cache-hit for emitSaveTiming. Within a warm cache scenario, this does indeed seem likely given that schema hasn't changed in years, whereas our other modules have.

https://graphite.wikimedia.org/render?width=1200&height=600&from=20180430&until=20180502&target=scale(mw.performance.save.sample_rate,60)

Event Timeline

Drop

Actually, the drop might be unrelated because that's for when wmf.1 rolled out. Whereas this is an issue with wmf.2 and hasn't even hit group2 yet.

Cause

Seems to be caused by the combination of 75a9b603479a and 34f971ee7de0d3 which are rolling out as part of wmf.2.

With 75a9b603479a, I suspect only SaveTiming broke (on views after page-save, on module cache-miss).

With 34f971ee7de0d3 added, I suspect NavTiming is broken as well (on views after a page-save, on module cache-miss), given it would evaluate the callback before reaching the NavTiming code in that case.

Using .then() instead of .done() would isolate the problem to emitSaveTiming only. But the easiest fix is probably to not re-use getNavTiming in this way and just pluck out navigationStart directly. This was harder in the past because it was re-using the isCompliance() check to some extent, but with that out of the way, we might as well access it directly instead of building an unused event object.

Change 430578 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/NavigationTiming@master] Emit SaveTiming without relying on getNavTiming()

https://gerrit.wikimedia.org/r/430578

Change 430634 had a related patch set uploaded (by Krinkle; owner: Gilles):
[mediawiki/extensions/NavigationTiming@wmf/1.32.0-wmf.2] Emit SaveTiming without relying on getNavTiming()

https://gerrit.wikimedia.org/r/430634

Change 430578 merged by jenkins-bot:
[mediawiki/extensions/NavigationTiming@master] Emit SaveTiming without relying on getNavTiming()

https://gerrit.wikimedia.org/r/430578

Change 430634 merged by jenkins-bot:
[mediawiki/extensions/NavigationTiming@wmf/1.32.0-wmf.2] Emit SaveTiming without relying on getNavTiming()

https://gerrit.wikimedia.org/r/430634

Mentioned in SAL (#wikimedia-operations) [2018-05-03T18:59:33Z] <thcipriani@tin> Synchronized php-1.32.0-wmf.2/extensions/NavigationTiming/modules/ext.navigationTiming.js: SWAT: [[gerrit:430634|Emit SaveTiming without relying on getNavTiming()]] T193693 (duration: 01m 16s)

Krinkle claimed this task.
Krinkle reassigned this task from Krinkle to Gilles.
Vvjjkkii renamed this task from Exception in load-callback for schema.SaveTiming: "ext.navigationTiming.rumSpeedIndex" not loaded to yqdaaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Gilles as the assignee of this task.
Vvjjkkii lowered the priority of this task from Unbreak Now! to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from yqdaaaaaaa to Exception in load-callback for schema.SaveTiming: "ext.navigationTiming.rumSpeedIndex" not loaded.Jul 2 2018, 6:50 AM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Gilles.
CommunityTechBot raised the priority of this task from High to Unbreak Now!.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.