lita-hufeng opened a new issue, #325:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/325

   ### Issue description
   
   When call request.getUpstreamHeaders() in postFilter, sometimes may cause 
IndexOutOfBoundsException.
   
   ### Environment
   
   apisix  3.9.0
   apisix-java-plugin-runner  0.6.0
   
   ### Minimal test code / Steps to reproduce the issue
   
   Not every time it happens, there is about 4 times happens of 10 .
   
   `
   java.lang.IndexOutOfBoundsException: null
           at java.base/java.nio.Buffer$1.apply(Buffer.java:757) ~[na:na]
           at java.base/java.nio.Buffer$1.apply(Buffer.java:754) ~[na:na]
           at 
java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) 
~[na:na]
           at 
java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) 
~[na:na]
           at 
java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) 
~[na:na]
           at 
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
 ~[na:na]
           at 
java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) 
~[na:na]
           at java.base/java.nio.Buffer.checkIndex(Buffer.java:779) ~[na:na]
           at 
java.base/java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:761) ~[na:na]
           at com.google.flatbuffers.Table.__vector_len(Table.java:125) 
~[flatbuffers-java-2.0.0.jar!/:na]
           at io.github.api7.A6.HTTPRespCall.Req.headersLength(Req.java:22) 
~[A6-0.6.0-RELEASE.jar!/:na]
           at 
org.apache.apisix.plugin.runner.PostRequest.getUpstreamHeaders(PostRequest.java:82)
 ~[apisix-runner-plugin-sdk-0.6.0.jar!/:0.6.0]
           at 
gg.lita.arch.gateway.plugin.filters.LitaLoginResponseFilter.getPostRequestHeaders(LitaLoginResponseFilter.java:52)
 ~[!/:0.0.1]
   `
   
   also PluginFilter implements is 
   
   `
       @Override
       public Boolean requiredBody() {
           return false;
       }
   
       @Override
       public Boolean requiredRespBody(){
           return true;
       }
   `
   
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   
   ### What's the expected result?
   
   expect request.getUpstreamHeaders() can return normally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to