I' m using Solr 3.1 right now.

I was looking at a threadump trying to figure out why queries were not
exactly fast and noticed that it keeps parsing xml over and over from
the schema to get the lucene version.

SolrQueryParser are created for each request and in the constructor
there is a call similar to

getSchema().getSolrConfig().getLuceneVersion("luceneMatchVersion",
Version.LUCENE_24)

which calls getVal() which is calling getNode() which creates a new
XPath object which ends up creating a new object factory which ends up
loading a class...

I cannot find a reference to this issue anywhere in jira nor google.
Hard to see right now how much effect that does have, but this seems
not quite optimal to do for every request.

Am I missing something obvious here ?

The stack looks like:

  java.lang.Thread.State: BLOCKED (on object monitor)
        at 
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:369)
        - waiting to lock <0x00002aaab3bb43b0> (a
org.mortbay.jetty.webapp.WebAppClassLoader)
        at 
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
        at 
com.sun.org.apache.xml.internal.dtm.ObjectFactory.findProviderClass(ObjectFactory.java:506)
        at 
com.sun.org.apache.xml.internal.dtm.ObjectFactory.lookUpFactoryClass(ObjectFactory.java:217)
        at 
com.sun.org.apache.xml.internal.dtm.ObjectFactory.createObject(ObjectFactory.java:131)
        at 
com.sun.org.apache.xml.internal.dtm.ObjectFactory.createObject(ObjectFactory.java:101)
        at 
com.sun.org.apache.xml.internal.dtm.DTMManager.newInstance(DTMManager.java:135)
        at 
com.sun.org.apache.xpath.internal.XPathContext.<init>(XPathContext.java:100)
        at 
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:201)
        at 
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
        at org.apache.solr.core.Config.getNode(Config.java:230)
        at org.apache.solr.core.Config.getVal(Config.java:256)
        at org.apache.solr.core.Config.getLuceneVersion(Config.java:325)
        at 
org.apache.solr.search.SolrQueryParser.<init>(SolrQueryParser.java:76)
        at 
org.apache.solr.schema.IndexSchema.getSolrQueryParser(IndexSchema.java:277)
        at 
org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:76)
        at org.apache.solr.search.QParser.getQuery(QParser.java:142)

Cheers,

-- stephane

Reply via email to