Bug #3294
closedThread contention on LRUCache.get
100%
Description
Running XQuery on Saxon-PE 9.7.0-18 with 4 concurrent threads running the same query, I am seeing a lot of contentions between threads with the following stack trace:
pool-1-thread-3 [BLOCKED]
java.util.Collections$SynchronizedMap.get(Object)
net.sf.saxon.expr.sort.LRUCache.get(Object) LRUCache.java:58
net.sf.saxon.lib.ConversionRules.getConverter(AtomicType, AtomicType) ConversionRules.java:196
net.sf.saxon.expr.CastExpression.doCast(AtomicValue, XPathContext) CastExpression.java:366
net.sf.saxon.expr.CastExpression.evaluateItem(XPathContext) CastExpression.java:405
net.sf.saxon.expr.CastExpression.evaluateItem(XPathContext) CastExpression.java:31
net.sf.saxon.expr.GeneralComparison.effectiveBooleanValue(XPathContext) GeneralComparison.java:616
net.sf.saxon.expr.instruct.Choose.choose(XPathContext) Choose.java:865
net.sf.saxon.expr.instruct.Choose.evaluateItem(XPathContext) Choose.java:893
net.sf.saxon.expr.LetExpression.evaluateItem(XPathContext) LetExpression.java:521
net.sf.saxon.expr.parser.ExpressionTool.evaluate(Expression, int, XPathContext, int) ExpressionTool.java:314
net.sf.saxon.expr.LetExpression.eval(XPathContext) LetExpression.java:500
net.sf.saxon.expr.LetExpression.processLeavingTail(XPathContext) LetExpression.java:702
net.sf.saxon.expr.instruct.Block.processLeavingTail(XPathContext) Block.java:653
net.sf.saxon.expr.instruct.Instruction.process(XPathContext) Instruction.java:149
net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(XPathContext, NodeInfo) ElementCreator.java:364
net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(XPathContext) ElementCreator.java:311
net.sf.saxon.expr.instruct.Instruction.process(XPathContext) Instruction.java:149
net.sf.saxon.expr.flwor.ReturnClausePush.processTuple(XPathContext) ReturnClausePush.java:37
net.sf.saxon.expr.flwor.ForClausePush.processTuple(XPathContext) ForClausePush.java:44
net.sf.saxon.expr.flwor.FLWORExpression.process(XPathContext) FLWORExpression.java:864
net.sf.saxon.expr.instruct.UserFunction.process(Sequence[], XPathContextMajor) UserFunction.java:626
net.sf.saxon.expr.UserFunctionCall.process(XPathContext) UserFunctionCall.java:549
net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(XPathContext, NodeInfo) ElementCreator.java:364
net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(XPathContext) ElementCreator.java:311
net.sf.saxon.expr.instruct.Instruction.process(XPathContext) Instruction.java:149
net.sf.saxon.expr.flwor.ReturnClausePush.processTuple(XPathContext) ReturnClausePush.java:37
net.sf.saxon.expr.flwor.ForClausePush.processTuple(XPathContext) ForClausePush.java:44
net.sf.saxon.expr.flwor.FLWORExpression.process(XPathContext) FLWORExpression.java:864
net.sf.saxon.expr.instruct.UserFunction.process(Sequence[], XPathContextMajor) UserFunction.java:626
net.sf.saxon.expr.UserFunctionCall.process(XPathContext) UserFunctionCall.java:549
net.sf.saxon.query.XQueryExpression.run(DynamicQueryContext, Result, Properties) XQueryExpression.java:414
net.sf.saxon.s9api.XQueryEvaluator.run(Destination) XQueryEvaluator.java:370
org.talend.transform.xquery.SaxonProcessor.run(Source, ContentHandler) SaxonProcessor.java:48
org.talend.transform.engine.xquery.XQueryConcurTest$MyCallable.call() XQueryConcurTest.java:114
org.talend.transform.engine.xquery.XQueryConcurTest$MyCallable.call() XQueryConcurTest.java:1
java.lang.Thread.run()
forum link: https://saxonica.plan.io/boards/4/topics/6819
Attached the xquery we are running.
Thank you
Files
Please register to edit this issue