A little bit off-toptic, but some time ago I used the pipeline machinery to generate mail-content for users, somewhere at night by a CRON job. For each user, the pipeline was called and the results were sent to that user. Processing such a pipeline from CRON took about 2 seconds for each mail, while calling that pipeline (trough the CocoonServlet), processing was done in less than 0.5 seconds. And after processing that pipeline 100 times (for 100 users), an OutOfMemoryError was thrown.
Any idea if this is related to your environment problems (CRON has it's own environment, right?) Bart. > -----Oorspronkelijk bericht----- > Van: Sylvain Wallez [mailto:[EMAIL PROTECTED] > Verzonden: dinsdag 7 juni 2005 19:03 > Aan: [email protected] > Onderwerp: Weird multithreading bug in Cron block > > Hi all, > > I'm currently working on a publication application with complex database > queries where we want to prefetch some of the pages linked to by the > page currently being produced, in order to speed up response time on > pages that are likely to be asked for by users. > > To achieve this, we have a "PrefetchTransformer" that grabs elements > having a prefetch="true" attribute and starts a background job to load > the corresponding "src" or "href" URL using a "cocoon:". > > At first I used JobScheduler.fireJob() to schedule for immediate > execution, but went into *weird* bugs with strange NPEs all around in > pipeline components. After analysis, it appeared that while the > scheduler thread was processing the pipeline, the http thread was > recycling the *background environment*, thus nulling the object model > and other class attributes used by pipeline components. > > I spent the *whole day* trying to find the cause for this, without > success (how frustrating). > > Then I decided to try another approach and use > JobScheduler.fireJobAt(new Date()), meaning "schedule the job for later > execution... now!". And it worked! > > Weird, weird, weird! Anybody having a hint about why fireJob() is doing > this environment mixture? > > Sylvain > > -- > Sylvain Wallez Anyware Technologies > http://apache.org/~sylvain http://anyware-tech.com > Apache Software Foundation Member Research & Technology Director
