Hi,

I checked the servicemix-saxon component code, but we don't call NamePool.allocate / NamePool.allocateNameSpaceCode in servicemix-saxon code, so we can't add the check as your suggestion here. I guess you can get call hierarchy details from "YourKit" to see which code actually call NamePool.allocate / NamePool.allocateNameSpaceCode.

Btw, if you are interested to be a contributor, you can take a look at the guide[1]. :-)

[1]http://servicemix.apache.org/contributing.html

Freeman

On 2010-3-4, at 上午2:49, Eighty8 wrote:


We've been wrestling with issues surrounding deadlocking/blocking on
synchronized method access under load in the saxon and eip API's. I first put in a manual throttling/sleep to keep threads from being aligned too closely to each other, then my teammate showed me the confiurable mbean
props for the LifeCycle properties of the eip and saxon services.

Putting in delays of 250 ms-500 ms helps.
But the core issue seems to be mis-use of synchronized API calls in
ServiceMix.
Here are a couple examples:

net.sf.saxon.om.NamePool.allocate(...)

net.sf.saxon.om.NamePool.allocateNameSpaceCode(...)

Simple fix...should be checking to see if the namespace exists before
calling 'allocate'  getNamesSpaceCode(...string...) returns '-1' if it
doesn't.  They clearly should be testing that before calling the
synchronized blocks.

ServiceMix code should not be calling synchronized method unless it has to. In these cases, I think checks need to be made before calling these allocate methods. I believe the name-spaces are already allocated, and therefore the
synchronized call is not needed at all.

I'm not a contributor and don't buidl servicemix myself, otherwise I'd be
happy to take this further and actually try to fix the code.
My throttling I considered a hack, to find then the throttling as a
'feature' made me kind of sad because the root cause of deadlocking/ blocking
would be better to be addressed.

Props to "Yourkit", as without that I would not have seen these issues at
all.

--
View this message in context: 
http://old.nabble.com/3.3-throttling-needed%2C-but-API-use-may-be-buggy-to-begin-with-tp27772120p27772120.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.



--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

Reply via email to