[Erp5-dev] Delayed reindex, workflow script and acquisition

Vera Kurpas vk at raskon.ru
Sun Nov 14 20:45:34 CET 2010


So where is the Unit Test preceded the patch
http://www.raskon.org/trac/erp5/changeset/b7ecd2b6fb76b07b9ba3304ab60f501bdb78b712 (svn r39710)? It looks like that it solves the similar problem (or may be the same)...  


В Сб., 13/11/2010 в 09:18 +0100, jp at nexedi.com пишет:
> Hi,
> 
> In order to progress in a useful manner, I suggest you to do as follows.
> 
> 1- write unit test which simulates what you describe and shows the problem
> 2- send it to the list
> 
> This is how we did ourselves when we had similar issues (which are normally fixed in recent versions).
> 
> Regards,
> 
> JPS.
> 
> 
> > Hi
> > 
> > I ran into a tricky issue caused by delayed reindexing and
> > fast-clicking users. Here is the scenario:
> > 
> > - there is a Document, which has some Lines
> > - Document is a member of a Category
> > - Lines acquire membership of a Category from their parent (Document)
> > - he Document belongs to a Workflow
> > - upon transition, the Workflow triggers a Script
> > - the Script iterates over Lines doing something to which it uses
> >   Category
> > 
> > Now what happens is:
> > - a user changes Category on Document and saves it
> > - then he executes workflow transition
> > 
> > The result is that the Script in most cases uses the new value of
> > Category, but sometimes it uses the old value. This is because
> > acquisition goes through portal catalog. If a users clicks through
> > workflow transition fast enough, before the reindexing is complete
> > (which is not uncommon), the outcome is confusion: scripts are ok, they
> > pass all tests, user did everything right, all data is correct, only
> > the goods went to a wrong warehouse.
> > 
> > Now, the only way I found to prevent it is to make the Script get a
> > category explicitly from parent (.getParent().getThisCategory()),
> > though it is only a workaround. The question is, where is the real
> > problem? I wrote a simple code, using legal techniques and basic API,
> > the application passed every test, the result was bad. Therefore, there
> > is a flaw in the core which we should nail down and fix.
> > 
> > Bartek
> > _______________________________________________
> > Erp5-dev mailing list
> > Erp5-dev at erp5.org
> > http://mail.nexedi.com/mailman/listinfo/erp5-dev
> > 
> _______________________________________________ Erp5-dev mailing list Erp5-dev at erp5.org http://mail.nexedi.com/mailman/listinfo/erp5-dev





More information about the Erp5-dev mailing list