GeoTools
  1. GeoTools
  2. GEOT-1980

Random failures parsing CQL under heavy load

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.4
    • Fix Version/s: 2.7-M0
    • Component/s: cql
    • Labels:
      None

      Description

      Trying the following request in GeoServer:
      /geoserver/wfs?request=GetFeature&PropertyName=HTML,GEOLOC&typeName=topp:SHLAA_2008&outputFormat=GML2&CQL_FILTER=INTERSECT(GEOLOC,%20POINT%20(615358%20312185))

      results in 459 failures with the following stack trace over 10.000 request made by 4 concurrent threads:

      Result:
      27 ago 18:00:27 WARN [geoserver.ows] - 
      org.vfny.geoserver.ServiceException: Could not parse CQL filter list.Expected word but found End-of-Stream, Current Token : POINT: INTERSECT(GEOLOC, POINT (615358 312185)), Current Token : )
      	at org.geoserver.wfs.kvp.CQLFilterKvpParser.parse(CQLFilterKvpParser.java:28)
      	at org.geoserver.ows.Dispatcher.parseKVP(Dispatcher.java:1002)
      	at org.geoserver.ows.Dispatcher.init(Dispatcher.java:212)
      	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:168)
      	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
      	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
      	at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:163)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
      	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
      	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
      	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      	at org.mortbay.jetty.Server.handle(Server.java:303)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
      	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      Caused by: org.geotools.filter.text.cql2.CQLException: Expected word but found End-of-Stream, Current Token : POINT: INTERSECT(GEOLOC, POINT (615358 312185)), Current Token : )
      	at org.geotools.filter.text.cql2.CQL.toFilterList(CQL.java:262)
      	at org.geotools.filter.text.cql2.CQL.toFilterList(CQL.java:220)
      	at org.geoserver.wfs.kvp.CQLFilterKvpParser.parse(CQLFilterKvpParser.java:26)
      	... 49 more
      Caused by: org.geotools.filter.text.cql2.CQLException: Expected word but found End-of-Stream, Current Token : POINT
      	at org.geotools.filter.text.cql2.CQLCompiler.buildGeometry(CQLCompiler.java:1234)
      	at org.geotools.filter.text.cql2.CQLCompiler.buildObject(CQLCompiler.java:537)
      	at org.geotools.filter.text.cql2.CQLCompiler.jjtreeCloseNodeScope(CQLCompiler.java:148)
      	at org.geotools.filter.text.cql2.CQLParser.PointTaggedText(CQLParser.java:2494)
      	at org.geotools.filter.text.cql2.CQLParser.GeometryLiteral(CQLParser.java:886)
      	at org.geotools.filter.text.cql2.CQLParser.GeoRoutineArgumentList(CQLParser.java:639)
      	at org.geotools.filter.text.cql2.CQLParser.RoutineInvocationGeoOp(CQLParser.java:423)
      	at org.geotools.filter.text.cql2.CQLParser.RoutineInvocation(CQLParser.java:340)
      	at org.geotools.filter.text.cql2.CQLParser.BooleanPrimary(CQLParser.java:272)
      	at org.geotools.filter.text.cql2.CQLParser.BooleanFactor(CQLParser.java:220)
      	at org.geotools.filter.text.cql2.CQLParser.BooleanTerm(CQLParser.java:177)
      	at org.geotools.filter.text.cql2.CQLParser.BooleanValueExpression(CQLParser.java:130)
      	at org.geotools.filter.text.cql2.CQLParser.SearchCondition(CQLParser.java:99)
      	at org.geotools.filter.text.cql2.CQLParser.SequenceOfSearchConditions(CQLParser.java:108)
      	at org.geotools.filter.text.cql2.CQLParser.MultipleCompilationUnit(CQLParser.java:92)
      	at org.geotools.filter.text.cql2.CQL.toFilterList(CQL.java:250)
      	... 51 more
      27 ago 18:00:27 WARN [geoserver.ows] - 
      java.lang.ClassCastException: org.geotools.filter.AttributeExpressionImpl cannot be cast to org.opengis.filter.Filter
      	at org.geotools.filter.visitor.PostPreProcessFilterSplittingVisitor.getFilterPre(PostPreProcessFilterSplittingVisitor.java:230)
      	at org.geotools.data.jdbc.DefaultSQLBuilder.splitFilter(DefaultSQLBuilder.java:179)
      	at org.geotools.data.jdbc.DefaultSQLBuilder.getPostQueryFilter(DefaultSQLBuilder.java:139)
      	at org.geotools.data.jdbc.JDBCFeatureSource.count(JDBCFeatureSource.java:423)
      	at org.geotools.data.jdbc.JDBCFeatureCollection.getCount(JDBCFeatureCollection.java:105)
      	at org.geotools.data.store.DataFeatureCollection.size(DataFeatureCollection.java:282)
      	at org.geotools.data.crs.ReprojectFeatureResults.size(ReprojectFeatureResults.java:198)
      	at org.geoserver.wfs.GetFeature.run(GetFeature.java:260)
      	at org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:129)
      	at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
      	at org.geoserver.wfs.WFSLogger.invoke(WFSLogger.java:44)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
      	at $Proxy0.getFeature(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.geoserver.security.OperationSecurityInterceptor.invoke(OperationSecurityInterceptor.java:41)
      	at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:533)
      	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:188)
      	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
      	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
      	at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:163)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
      	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
      	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
      	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      	at org.mortbay.jetty.Server.handle(Server.java:303)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
      	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      

      The test was made against gs 1.6.5-beta, so gt2 2.4.x
      Are you aware of any threading issue?

        Activity

        Hide
        Mauricio Pazos added a comment -
        Hello Andrea, right now I am in holidays, I am going to review this bug the next week.
        cheers
        Show
        Mauricio Pazos added a comment - Hello Andrea, right now I am in holidays, I am going to review this bug the next week. cheers
        Hide
        Mauricio Pazos added a comment -
        testIntersects funcion (test case) was added to CQLTest (it look right)

        r31382 /branches/2.4.x/modules/library/cql/src/test/java/org/geotools/filter/text/cql2/CQLTest.java: GEOT-1980 intersects test was added (modified to use a list of filter)


        Show
        Mauricio Pazos added a comment - testIntersects funcion (test case) was added to CQLTest (it look right) r31382 /branches/2.4.x/modules/library/cql/src/test/java/org/geotools/filter/text/cql2/CQLTest.java: GEOT-1980 intersects test was added (modified to use a list of filter)
        Hide
        Mauricio Pazos added a comment -
        Thinking in to catch this bug I add the following improvement
        Exception handling was improved adding more detail into the messages.
        Defensive copy of cql statement
        (committed into branches/2.4.x/)

        Andrea let me know if the bug appear.
        Show
        Mauricio Pazos added a comment - Thinking in to catch this bug I add the following improvement Exception handling was improved adding more detail into the messages. Defensive copy of cql statement (committed into branches/2.4.x/) Andrea let me know if the bug appear.
        Hide
        Jody Garnett added a comment -
        So if this has not reappeared we should assume the fix worked?
        Show
        Jody Garnett added a comment - So if this has not reappeared we should assume the fix worked?

          People

          • Assignee:
            Mauricio Pazos
            Reporter:
            Andrea Aime
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: