make deriver update metamgr immediately after meta.xml is modified

Bug #223906 reported by raj
2
Affects Status Importance Assigned to Milestone
Deriver
New
Undecided
Unassigned

Bug Description

We currently update the metamgr after the derive completes. This is problematic for long derives.

Revision history for this message
danh (danh-archive) wrote :

The current plan is to modify petabox/deriver/inc/Deriver.inc right after it calls the preDerive() method of the BookItemOperation class.

This is based on conversations with Steve, Raj, and Hank (although the exact details here may have to be modified yet more).

There will be a function call made right at that point to some function (which will wrap around the metaTableUpdater) to update the metadata.

Right now, the preDerive is wrapped in a try {} catch block.

The new call could go inside that block, or immediately afterwards.

My plan is to put it immediately afterwards, because the policy on whether to fail due to an unsuccessful book operation is not necessarily the same as the policy on whether to fail due to inability to write to the database.

Because access to the database is not guaranteed, and there will be a second chance to write to the database at the end of the derive (which might be days later), it would seem better to at least have the option of not failing on database access, but definitely failing on book operation malfunction.

Anybody reading this please correct me, and thanks in advance.

Revision history for this message
danh (danh-archive) wrote :

First modified the metaTableUpdater a little (per Steve) to check on each preg_match() that there actually was matched data before using that data to update the meta table.

Then modified Deriver.inc to call update() on a metaTableUpdater object. This involved a little setup: the *_files.xml has to exist as well as the *_meta.xml in order to marshall all the data we need via ItemXML.

Anybody who wants to take a look over the code and point out any problems please do so, and thanks in advance:
   petabox/www/common/metaTableUpdater.inc
   petabox/deriver/inc/Deriver.inc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.