You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Markus Angst <ma...@inventec.ch> on 2007/08/29 20:55:21 UTC

Mark AxisUUIDGenerator as ThreadSafe

Hi Andreas,

Jürgen just pointed me to your commits re Mark AxisUUIDGenerator as ThreadSafe
(revisions 570864 and 570866). I guess you also have experienced a "document
already exists" message. Mine was during import of the example content.
After having been hunting the bug for hours my (humble) theory is that the axis
people have already fixed the problem. See
http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?view=log
revision 448984.

I guess the cocoon people should update their respective axis jars. They look
old to me.

Regards,
Markus Angst

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Mark AxisUUIDGenerator as ThreadSafe

Posted by Andreas Hartmann <an...@apache.org>.
Markus Angst schrieb:

[...]

>>> I don't understand enough of the ThreadSafe interface
>> It just tells the container to create only one instance of the service
>> which is shared by all clients.
> 
> Does this guarantee that a synchronization bug which is definitely present in
> the old version of FastUUIDGen.nextUUID() cannot occur?

I think so. They replaced the object lock with the class lock. With the
AxisUUIDGenerator being ThreadSafe, an object lock is in fact the same
as a class lock because only one object exists.

-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Mark AxisUUIDGenerator as ThreadSafe

Posted by Markus Angst <ma...@inventec.ch>.
Andreas Hartmann wrote:
> Markus Angst schrieb:
>> Hi Andreas,
>>
>>>> Jürgen just pointed me to your commits re Mark AxisUUIDGenerator as ThreadSafe
>>>> (revisions 570864 and 570866). I guess you also have experienced a "document
>>>> already exists" message. Mine was during import of the example content.
>>> you mean the problem occured after my check-in? 
>> Sorry, my post was unclear. I experienced the problem before your commit. Your
>> commit fixes the problem as far as I can tell. Thanks for the fix :-)
> 
> I didn't experience the problem before, I just noticed during memory
> leak debugging that each modifiable session created its own
> AxisUUIDGenerator instance, which woulnd't be necessary :)

The problem I experienced during example content import was an attempt to create
two subsequent documents with the same UUID. It looked like a timing problem;
when i started lenya with the option "servlet-debug" the problem did not occur
any more.

>>> I couldn't reproduce it (yet), but you might try to synchronize the nextUUID() 
>>> method in the AxisUUIDGenerator.
>> That's where my point comes. I think the axis people have found the bug in their
>>  FastUUIDGen.java and fixed it on 2006-09-22. See
>> http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?r1=264831&r2=448984
>> for the diff.
>> The problem is that cocoon comes with axis jars that were released on
>> 2004-12-16. I think that cocoon should update their jars. Don't know how simple
>> that is, though.
> 
> You could send a mail to cocoon-dev, I don't think they'll object to
> updating.

I will do that.

>> I don't understand enough of the ThreadSafe interface
> 
> It just tells the container to create only one instance of the service
> which is shared by all clients.

Does this guarantee that a synchronization bug which is definitely present in
the old version of FastUUIDGen.nextUUID() cannot occur? You can see that this is
what they fixed when you have a quick peek at the diff i mentioned.

>> but i think your commit is
>> only masking the real bug which is located in the old axis jars of cocoon.
> 
> OK, than we should definitely tell them to update the jars.
> Thanks for the explanation!

I am not feeling to explain anything to you because i would simply not be able
to. It would rather have to be the other way round ;-) I only want to help make
things better by expressing my humble opinion and pointing to stuff that i found
which i feel would be worth having a look at :-)

Thanks!
Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Mark AxisUUIDGenerator as ThreadSafe

Posted by Andreas Hartmann <an...@apache.org>.
Markus Angst schrieb:
> Hi Andreas,
> 
>>> Jürgen just pointed me to your commits re Mark AxisUUIDGenerator as ThreadSafe
>>> (revisions 570864 and 570866). I guess you also have experienced a "document
>>> already exists" message. Mine was during import of the example content.
>> you mean the problem occured after my check-in? 
> 
> Sorry, my post was unclear. I experienced the problem before your commit. Your
> commit fixes the problem as far as I can tell. Thanks for the fix :-)

I didn't experience the problem before, I just noticed during memory
leak debugging that each modifiable session created its own
AxisUUIDGenerator instance, which woulnd't be necessary :)


>> I couldn't reproduce it (yet), but you might try to synchronize the nextUUID() 
>> method in the AxisUUIDGenerator.
> 
> That's where my point comes. I think the axis people have found the bug in their
>  FastUUIDGen.java and fixed it on 2006-09-22. See
> http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?r1=264831&r2=448984
> for the diff.
> The problem is that cocoon comes with axis jars that were released on
> 2004-12-16. I think that cocoon should update their jars. Don't know how simple
> that is, though.

You could send a mail to cocoon-dev, I don't think they'll object to
updating.

> I don't understand enough of the ThreadSafe interface

It just tells the container to create only one instance of the service
which is shared by all clients.

> but i think your commit is
> only masking the real bug which is located in the old axis jars of cocoon.

OK, than we should definitely tell them to update the jars.
Thanks for the explanation!

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Mark AxisUUIDGenerator as ThreadSafe

Posted by Markus Angst <ma...@inventec.ch>.
Hi Andreas,

>> Jürgen just pointed me to your commits re Mark AxisUUIDGenerator as ThreadSafe
>> (revisions 570864 and 570866). I guess you also have experienced a "document
>> already exists" message. Mine was during import of the example content.
> 
> you mean the problem occured after my check-in? 

Sorry, my post was unclear. I experienced the problem before your commit. Your
commit fixes the problem as far as I can tell. Thanks for the fix :-)

> I couldn't reproduce it (yet), but you might try to synchronize the nextUUID() 
> method in the AxisUUIDGenerator.

That's where my point comes. I think the axis people have found the bug in their
 FastUUIDGen.java and fixed it on 2006-09-22. See
http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?r1=264831&r2=448984
for the diff.
The problem is that cocoon comes with axis jars that were released on
2004-12-16. I think that cocoon should update their jars. Don't know how simple
that is, though.
I don't understand enough of the ThreadSafe interface but i think your commit is
only masking the real bug which is located in the old axis jars of cocoon.
Although, as i said, it helps for the moment, thanks :-)

Just my two cents.

Thanks!
Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Mark AxisUUIDGenerator as ThreadSafe

Posted by Andreas Hartmann <an...@apache.org>.
Hi Markus,

Markus Angst schrieb:
> Jürgen just pointed me to your commits re Mark AxisUUIDGenerator as ThreadSafe
> (revisions 570864 and 570866). I guess you also have experienced a "document
> already exists" message. Mine was during import of the example content.

you mean the problem occured after my check-in? I couldn't reproduce it
(yet), but you might try to synchronize the nextUUID() method in the
AxisUUIDGenerator.

Thanks for the pointer!

-- Andreas

> After having been hunting the bug for hours my (humble) theory is that the axis
> people have already fixed the problem. See
> http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?view=log
> revision 448984.
> 
> I guess the cocoon people should update their respective axis jars. They look
> old to me.
> 
> Regards,
> Markus Angst


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org