You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Shyamsunder R Mutcha <sj...@yahoo.com> on 2013/11/25 16:43:11 UTC

ConcurrentModificationException from XMLResponseWriter


Following exception is found in solr logs. We are using Solr 3.2. As the stack trace is not referring to any application classes, I couldn't figure out the piece of code that throws this exception. Is there any way to debug this issue?

Is it related to the issue ConcurrentModificationException from BinaryResponseWriter 

Nov 25, 2013 7:10:56 AM org.apache.solr.common.SolrException log
SEVERE: java.util.ConcurrentModificationException
        at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
        at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:392)
        at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:391)
        at org.apache.solr.response.XMLWriter.writeMap(XMLWriter.java:644)
        at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:591)
        at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
        at org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
        at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:343)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:265)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:662)

Thanks

Re: ConcurrentModificationException from XMLResponseWriter

Posted by Shyamsunder R Mutcha <sj...@yahoo.com>.
Shawn,

We have custom search handlers that uses in built components - result and facet to generate the results. I see that our facet generation is using the LinkedHashMap. I will revisit my code. Thanks for the advise!!!

We are migrating to Solr4 soon :)

Thanks



On Monday, November 25, 2013 11:28 AM, Shawn Heisey <so...@elyograg.org> wrote:
 
On 11/25/2013 8:43 AM, Shyamsunder R Mutcha wrote:
> 
> 
> Following exception is found in solr logs. We are using Solr 3.2. As the stack trace is not referring to any application classes, I couldn't figure out the piece of code that throws this exception. Is there any way to debug this issue?
> 
> Is it related to the issue ConcurrentModificationException from BinaryResponseWriter 
> 
> Nov 25, 2013 7:10:56 AM org.apache.solr.common.SolrException log
> SEVERE: java.util.ConcurrentModificationException
>         at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
>         at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:392)
>         at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:391)
>         at org.apache.solr.response.XMLWriter.writeMap(XMLWriter.java:644)

The exception is coming from LinkedHashMap, a built-in Java object type.

http://docs.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html

The code that made the call that's failing is line 644 of this source
code file:

solr/core/src/java/org/apache/solr/response/XMLWriter.java

I looked at the 3.2 source code.  What's going on here is fairly normal
- it's interating through a Map and outputting the data contained there
to the writer.

The actual problem is occurring elsewhere, it's only showing up in
XMLWriter due to the way LinkedHashMap objects work.  Another thread has
modified the Map while the iterator is being used. This is something
you're not allowed to do with this object type, so it throws the exception.

I can't find any existing Solr bugs, so the question is: Are you using
any custom code with Solr?  Perhaps something you downloaded or
purchased, or something you wrote in-house?  If so, then that code has
some bugs.

If this *is* a bug in Solr 3.x, it is highly unlikely that it will get
fixed, at least in a 3.x version.  If it still exists in version 4.x
(which is unlikely), then it will get fixed there.  Version 3.2 is two
years old, and the entire 3.x branch is in maintenance mode, meaning
that only EXTREMELY severe bugs will be fixed.


Thanks,
Shawn

Re: ConcurrentModificationException from XMLResponseWriter

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/25/2013 8:43 AM, Shyamsunder R Mutcha wrote:
> 
> 
> Following exception is found in solr logs. We are using Solr 3.2. As the stack trace is not referring to any application classes, I couldn't figure out the piece of code that throws this exception. Is there any way to debug this issue?
> 
> Is it related to the issue ConcurrentModificationException from BinaryResponseWriter 
> 
> Nov 25, 2013 7:10:56 AM org.apache.solr.common.SolrException log
> SEVERE: java.util.ConcurrentModificationException
>         at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
>         at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:392)
>         at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:391)
>         at org.apache.solr.response.XMLWriter.writeMap(XMLWriter.java:644)

The exception is coming from LinkedHashMap, a built-in Java object type.

http://docs.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html

The code that made the call that's failing is line 644 of this source
code file:

solr/core/src/java/org/apache/solr/response/XMLWriter.java

I looked at the 3.2 source code.  What's going on here is fairly normal
- it's interating through a Map and outputting the data contained there
to the writer.

The actual problem is occurring elsewhere, it's only showing up in
XMLWriter due to the way LinkedHashMap objects work.  Another thread has
modified the Map while the iterator is being used. This is something
you're not allowed to do with this object type, so it throws the exception.

I can't find any existing Solr bugs, so the question is: Are you using
any custom code with Solr?  Perhaps something you downloaded or
purchased, or something you wrote in-house?  If so, then that code has
some bugs.

If this *is* a bug in Solr 3.x, it is highly unlikely that it will get
fixed, at least in a 3.x version.  If it still exists in version 4.x
(which is unlikely), then it will get fixed there.  Version 3.2 is two
years old, and the entire 3.x branch is in maintenance mode, meaning
that only EXTREMELY severe bugs will be fixed.

Thanks,
Shawn