ConcurrentModificationException in concurrent WFS requests with GML 3.2 output

Description

ConcurrentModificationExceptions are happening during WFS requests for data transformations. The app-schema plugin is being leveraged to provide the XML format for the response.

Stack trace is attached.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 4:33 PM

CodeHaus Comment From: bencaradocdavies - Time: Fri, 27 Feb 2015 17:54:08 -0600
---------------------
<p>Jerry, apologies for the delay in responding to this issue.</p>

<p>I could not see anything specific to app-schema in these stack traces, so I tried using a variant of your stress-testing script with the topp:states shipped with the geoserver release bundle (2.7-RC1) and was able to reproduce the exception. The app-schema plugin was <b>not</b> installed.</p>

<p>Tested with:</p>

<p>openjdk-7-jdk:amd64 7u75-2.5.4-2 amd64 on debian/sid</p>

<p>apache-tomcat-7.0.56 (from the official .tar.gz) running with the following settings in catalina.sh:

export JAVA_OPTS="-Xmx1024m -XX:MaxPermSize=256m"</p>

<p>geoserver.war from <a href="http://sourceforge.net/projects/geoserver/files/GeoServer/2.7-RC1/geoserver-2.7-RC1-war.zip" class="external-link" rel="nofollow">http://sourceforge.net/projects/geoserver/files/GeoServer/2.7-RC1/geoserver-2.7-RC1-war.zip</a></p>

<p>The app-schema plugin is <b>not</b> installed.</p>

codehaus
April 10, 2015, 4:33 PM

CodeHaus Comment From: bencaradocdavies - Time: Fri, 27 Feb 2015 17:55:36 -0600
---------------------
<p>Attached the script used for stress testing and an excerpt from geoserver.log containing the exception report.</p>

codehaus
April 10, 2015, 4:33 PM

CodeHaus Comment From: bencaradocdavies - Time: Fri, 27 Feb 2015 18:16:38 -0600
---------------------
<p>Testing WFS 2.0 <b>often</b> causes this failure:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>./states-2.0.sh &amp;&gt; /dev/null
</pre>
</div></div>

<p>Testing WFS 1.1 I have <b>never</b> observed this failure:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>./states-2.0.sh &amp;&gt; /dev/null
</pre>
</div></div>

<p>The failure is <b>often</b> seen with WFS 1.1 with GML 3.2 output:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>./states-1.1-gml32.sh &amp;&gt; /dev/null
</pre>
</div></div>

<p>So it looks like GML 3.2 output is the culprit.</p>

codehaus
April 10, 2015, 4:33 PM

CodeHaus Comment From: aaime - Time: Sun, 1 Mar 2015 04:35:22 -0600
---------------------
<p>Assigning to the author of the class in question. Justin, does it ring a bell, could it be an easy fix?</p>

codehaus
April 10, 2015, 4:33 PM

CodeHaus Comment From: jwilwerd - Time: Mon, 2 Mar 2015 10:29:40 -0600
---------------------
<p>Consider adding a synchronized(Schemas.class) block that covers almost all of the FeatureTypeSchemaBuilder.buildSchemaInternal method; the only items not in the block are the factory and schema variable declarations. This solved ConcurrentModificationException issue for me on both 2.5.1 and 2.7-beta. In addition to being validated for correctness, this potential solution needs to be evaluated for performance implications due to the addition of a large synchronized block. If nothing else, hopefully this helps point you to the section of code.</p>

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure