New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GEOT-5602] Better concurrent SoftValueHashMap #1424

Merged
merged 1 commit into from Jan 9, 2017

Conversation

Projects
None yet
3 participants
@ugomos
Contributor

ugomos commented Dec 22, 2016

https://osgeo-org.atlassian.net/browse/GEOT-5602

SoftValueHashMap now supports concurrency better, using ConcurrentHashMap and ConcurrentLinkedQueue.

Show outdated Hide outdated ...s/library/metadata/src/main/java/org/geotools/util/SoftValueHashMap.java Outdated
final V v = (V) value;
return v;
}
value = ((Reference<K, V>) value).getAndClear();

This comment has been minimized.

@aaime

aaime Dec 22, 2016

Member

Oh, interesting... but this means we need to only clear the soft reference, but not actually call the cleaner as the object is not being destroyed

@aaime

aaime Dec 22, 2016

Member

Oh, interesting... but this means we need to only clear the soft reference, but not actually call the cleaner as the object is not being destroyed

Show outdated Hide outdated ...s/library/metadata/src/main/java/org/geotools/util/SoftValueHashMap.java Outdated
Show outdated Hide outdated ...s/library/metadata/src/main/java/org/geotools/util/SoftValueHashMap.java Outdated
@aaime

aaime approved these changes Jan 9, 2017

@aaime

This comment has been minimized.

Show comment
Hide comment
@aaime

aaime Jan 9, 2017

Member

Tested in a benchmark setting, it indeed improves scalability

Member

aaime commented Jan 9, 2017

Tested in a benchmark setting, it indeed improves scalability

@aaime aaime merged commit ff3bdeb into geotools:master Jan 9, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bencaradocdavies

This comment has been minimized.

Show comment
Hide comment
@bencaradocdavies

bencaradocdavies Jan 13, 2017

Member

Looks like this PR causes intermittent build failures in GeoServer gs-wms:
http://osgeo-org.1560.x6.nabble.com/Random-WMS-failure-on-build-box-td5303350.html

Member

bencaradocdavies commented Jan 13, 2017

Looks like this PR causes intermittent build failures in GeoServer gs-wms:
http://osgeo-org.1560.x6.nabble.com/Random-WMS-failure-on-build-box-td5303350.html

@aaime

This comment has been minimized.

Show comment
Hide comment
@aaime

aaime Jan 14, 2017

Member

Reverting as it's causing build failures in GeoServer. The full stack trace is:

14 Jan 11:17:43 ERROR [geotools.rendering] - org.geotools.util.SoftValueHashMap$Reference cannot be cast to org.opengis.referencing.operation.CoordinateOperation
java.lang.ClassCastException: org.geotools.util.SoftValueHashMap$Reference cannot be cast to org.opengis.referencing.operation.CoordinateOperation
	at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:256)
	at org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:688)
	at org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:635)
	at org.geotools.renderer.crs.ProjectionHandler.preProcess(ProjectionHandler.java:417)
	at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getTransformedShape(StreamingRenderer.java:3117)
	at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3077)
	at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:2549)
	at org.geotools.renderer.lite.StreamingRenderer.processFeature(StreamingRenderer.java:2449)
	at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2306)
	at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1927)
	at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:831)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:545)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:268)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:138)
	at org.geoserver.wms.GetMap.executeInternal(GetMap.java:623)
	at org.geoserver.wms.GetMap.run(GetMap.java:279)
	at org.geoserver.wms.GetMap.run(GetMap.java:125)
	at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:320)
	at sun.reflect.GeneratedMethodAccessor682.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:33)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
	at com.sun.proxy.$Proxy44.getMap(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor683.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:850)
	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:268)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
	at org.geoserver.test.GeoServerSystemTestSupport$1.service(GeoServerSystemTestSupport.java:1478)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167)
	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)
	at org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1505)
	at org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1436)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:977)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:960)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsImage(GeoServerSystemTestSupport.java:1248)
	at org.geoserver.wms.wms_1_1_1.GetMapIntegrationTest.testAdvancedProjectionHandling(GetMapIntegrationTest.java:1094)
Member

aaime commented Jan 14, 2017

Reverting as it's causing build failures in GeoServer. The full stack trace is:

14 Jan 11:17:43 ERROR [geotools.rendering] - org.geotools.util.SoftValueHashMap$Reference cannot be cast to org.opengis.referencing.operation.CoordinateOperation
java.lang.ClassCastException: org.geotools.util.SoftValueHashMap$Reference cannot be cast to org.opengis.referencing.operation.CoordinateOperation
	at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:256)
	at org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:688)
	at org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:635)
	at org.geotools.renderer.crs.ProjectionHandler.preProcess(ProjectionHandler.java:417)
	at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getTransformedShape(StreamingRenderer.java:3117)
	at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3077)
	at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:2549)
	at org.geotools.renderer.lite.StreamingRenderer.processFeature(StreamingRenderer.java:2449)
	at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2306)
	at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1927)
	at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:831)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:545)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:268)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:138)
	at org.geoserver.wms.GetMap.executeInternal(GetMap.java:623)
	at org.geoserver.wms.GetMap.run(GetMap.java:279)
	at org.geoserver.wms.GetMap.run(GetMap.java:125)
	at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:320)
	at sun.reflect.GeneratedMethodAccessor682.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:33)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
	at com.sun.proxy.$Proxy44.getMap(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor683.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:850)
	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:268)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
	at org.geoserver.test.GeoServerSystemTestSupport$1.service(GeoServerSystemTestSupport.java:1478)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167)
	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)
	at org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1505)
	at org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1436)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:977)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:960)
	at org.geoserver.test.GeoServerSystemTestSupport.getAsImage(GeoServerSystemTestSupport.java:1248)
	at org.geoserver.wms.wms_1_1_1.GetMapIntegrationTest.testAdvancedProjectionHandling(GetMapIntegrationTest.java:1094)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment