Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-280

NPE on rate limiting policy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.x, 1.0.3.Final
    • 1.0.2.Final
    • Gateway
    • None
    • Hide

      1. Define a public service similar to the movie.
      2. Add a rate limit policy say 10 request per minute.
      3. Go into Rest client, invoke the services n times (not quite sure what n was, seems to be less than 10), but I did get a 429 which I thought was good.
      4. I then waited for a little while.
      5. I tried the Rest client again, I invoked the services over 10 times, many times but I never saw the 429 again.
      6. This was odd. So I stopped the server.
      7. Restart the server.
      8. Try to invoke the same service again, and I got the NPE.

      Pls let me know if you can reproduce. Thx.

      Show
      1. Define a public service similar to the movie. 2. Add a rate limit policy say 10 request per minute. 3. Go into Rest client, invoke the services n times (not quite sure what n was, seems to be less than 10), but I did get a 429 which I thought was good. 4. I then waited for a little while. 5. I tried the Rest client again, I invoked the services over 10 times, many times but I never saw the 429 again. 6. This was odd. So I stopped the server. 7. Restart the server. 8. Try to invoke the same service again, and I got the NPE. Pls let me know if you can reproduce. Thx.

    Description

      java.lang.NullPointerException
      	at io.apiman.gateway.engine.ispn.InfinispanRateLimiterComponent.accept(InfinispanRateLimiterComponent.java:106)
      	at io.apiman.gateway.engine.policies.RateLimitingPolicy.doApply(RateLimitingPolicy.java:80)
      	at io.apiman.gateway.engine.policies.RateLimitingPolicy.doApply(RateLimitingPolicy.java:38)
      	at io.apiman.gateway.engine.policies.AbstractMappedPolicy.apply(AbstractMappedPolicy.java:68)
      	at io.apiman.gateway.engine.policy.RequestChain.applyPolicy(RequestChain.java:65)
      	at io.apiman.gateway.engine.policy.Chain.doApply(Chain.java:143)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl$1.handle(ServiceRequestExecutorImpl.java:173)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl$1.handle(ServiceRequestExecutorImpl.java:126)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl$2.handle(ServiceRequestExecutorImpl.java:232)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl$2.handle(ServiceRequestExecutorImpl.java:202)
      	at io.apiman.gateway.engine.policy.PolicyFactoryImpl.loadPolicy(PolicyFactoryImpl.java:81)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl.loadPolicies(ServiceRequestExecutorImpl.java:202)
      	at io.apiman.gateway.engine.impl.ServiceRequestExecutorImpl.execute(ServiceRequestExecutorImpl.java:126)
      	at io.apiman.gateway.platforms.servlet.GatewayServlet.doAction(GatewayServlet.java:190)
      	at io.apiman.gateway.platforms.servlet.GatewayServlet.doGet(GatewayServlet.java:79)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
      	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Activity

          People

            ewittman@redhat.com Eric Wittmann
            christinalau28 Christina Lau (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: