Java Mailing List Archive

http://www.junlu.com/

Home » FreeMarker-user »

Re: [FreeMarker-user] Deadlock issue

Jacopo Cappellato

2012-05-18

Replies: Find Java Web Hosting

Author LoginPost Reply
I just noticed the work in:

https://sourceforge.net/tracker/?func=detail&aid=3514821&group_id=794&atid=300794

This could be a (better) version that overlaps with one of the two patches I have attached.

Jacopo


On May 18, 2012, at 9:49 AM, Jacopo Cappellato wrote:

> Hi Daniel,
>
> did you get a chance to review the patch files I have attached to:
>
> https://sourceforge.net/tracker/?func=detail&aid=3519805&group_id=794&atid=100794
>
> ?
>
> Let me know if you have any feedback for enhancements because I am interested to see them committed and so I am happy to improve them if required.
>
> Kind regards,
>
> Jacopo
>
> On Apr 22, 2012, at 10:29 AM, Daniel Dekany wrote:
>
>> Sunday, April 22, 2012, 8:21:38 AM, Jacopo Cappellato wrote:
>>
>>>
>>> On Apr 20, 2012, at 6:23 PM, Daniel Dekany wrote:
>>>
>>>> Friday, April 20, 2012, 2:33:44 PM, Jacopo Cappellato wrote:
>>>>
>>>>> Hi Daniel,
>>>>>
>>>>> On Apr 20, 2012, at 2:21 PM, Daniel Dekany wrote:
>>>>>
>>>>>> Friday, April 20, 2012, 10:37:52 AM, Jacopo Cappellato wrote:
>>>>>>
>>>>>>> Daniel D., Daniel L.,
>>>>>>>
>>>>>>> thanks to both of you for the valuable help.
>>>>>>>
>>>>>>> I was able to find and fix the OFBiz code that was causing the
>>>>>>> multiple reload of Groovy related classes: in OFBiz there was cache
>>>>>>> object containing the parsed Groovy scripts that was not managed in
>>>>>>> a thread safe way.
>>>>>>
>>>>>> So then can it still occur that a Groovy-script-class is reloaded even
>>>>>> if the script wasn't modified, only not so often?
>>>>>
>>>>> It should no more happen now: the OFBiz cache object is now
>>>>> properly synchronized and even if multiple threads will try to
>>>>> compile the same script only the first Groovy-script-class will be
>>>>> added to the cache and then used to renderthe freemarker template.
>>>>> After this change all "reload" messages from freemarker disappeared.
>>>>
>>>> What I meant is that if these are in-memory-only classes, the Groovy
>>>> script cache might drops some of them sometimes. If it's that kind of
>>>> cache.
>>>
>>> Oh yes, when you clear the cache in OFBiz
>>
>> Which, I hope, doesn't happen often.
>>
>>> then Freemarker will reload its caches; however, with the fix I did
>>> in OFBiz, Freemarker will now reload the cache only once while
>>> before it could reload it several times (we had a bug in OFBiz that
>>> prevented properly handling of concurrency and the same class was
>>> compiled and added to the cache several times).
>>>
>>> We are testing now the fixes in production and they seem to have solved the problem, so thank you!
>>>
>>> As a side note: I would like to propose/submit some patches to
>>> improve the implementation of synchronized code in BeansWrapper and
>>> so I am wondering if it would make sense to sign the CLA; I am an
>>> active committer (and I am in the OFBiz PMC) of OFBiz and we are
>>> using Freemarker extensively so it could be useful also in the
>>> future (if we will ever find a bug). In the same time I don't want
>>> to put on your shoulders unnecessary paperwork, so please disregard
>>> my proposal if you feel that a CLA is an overkill.
>>
>> This paper work is not a big deal for us. I will email the CLA form.
>>
>>> Kind regards,
>>>
>>> Jacopo
>>
>> --
>> Best regards,
>> Daniel Dekany
>>
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
FreeMarker-user mailing list
FreeMarker-user@(protected)
https://lists.sourceforge.net/lists/listinfo/freemarker-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.