Page MenuHomePhabricator

When inserting jobs, JobQueue loses interwiki prefix and fragment of titles
Closed, DeclinedPublic

Description

In bug 57464 we noticed that any namespace prefix which was also an interwiki prefix mysteriously vanishes when using a cross-wiki job. After digging a bit, I've found why, and believe it's a core issue. I'm going to describe what is wrong in JobQueueRedis, though the same issue is in JobQueueDB too. Didn't check the other implementations.

JobQueueRedis::doBatchPush calls JobQueueReids::getNewJobFields which basically serializes the Job object.

When converting the title object, it stores the namespace integer and DBkey.

When reconstructing in JobQueueRedis::getJobFromFields, it does Title::makeTitleSafe( $fields['namespace'], $fields['title'] )

This means the interwiki prefix and fragment will mysteriously vanish, since neither are included in the DBkey.

I recommend that the interwiki prefix and fragment are also extracted in getNewJobFields and used when reconstructing the title object in getJobFromFields.

Note that even that would not have fixed bug 57464, there still would have been a namespace/interwiki collision.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=57464

Details

Reference
bz58524

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:25 AM
bzimport set Reference to bz58524.
bzimport added a subscriber: Unknown Object (MLST).

I'd suggest not use the main job title and storing the params manually for this extension.

The whole forced Title thing is mostly old cruft and some jobs don't even need a title. You can always used a dummy title for the job title field. If anything it should be deprecated altogether.

That makes sense, and I guess this is just a symptom of bug 42862.