[ 
https://issues.apache.org/jira/browse/GEODE-8221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17137992#comment-17137992
 ] 

ASF GitHub Bot commented on GEODE-8221:
---------------------------------------

boglesby commented on pull request #5246:
URL: https://github.com/apache/geode/pull/5246#issuecomment-645070010


   Tomcat9DeltaSessionManager with Tomcat 9.0.33:
   
   I see the same behavior as above, but only 3 times instead of 4. The same 
kind of change in Tomcat9CommitSessionValve.wrapResponse addresses the issue:
   ```
   if (!(delegateOutputBuffer instanceof Tomcat9CommitSessionOutputBuffer)) {
     final Request request = response.getRequest();
     final OutputBuffer sessionCommitOutputBuffer =
       new Tomcat9CommitSessionOutputBuffer(() -> commitSession(request), 
delegateOutputBuffer);
     coyoteResponse.setOutputBuffer(sessionCommitOutputBuffer);
   }
   ```
   One difference in behavior between 8 and 9 is this NPE right at the start of 
the test. It happens before my index.jsp is displayed and doesn't seem to 
affect anything. It probably should be addressed, though.
   ```
   16-Jun-2020 16:54:11.924 SEVERE [http-nio-8080-exec-3] 
org.apache.coyote.http11.Http11Processor.service Error processing request
        java.lang.NullPointerException
                at 
org.apache.geode.modules.session.catalina.AbstractCommitSessionValve.commitSession(AbstractCommitSessionValve.java:63)
                at 
org.apache.geode.modules.session.catalina.Tomcat9CommitSessionValve.lambda$wrapResponse$0(Tomcat9CommitSessionValve.java:44)
                at 
org.apache.geode.modules.session.catalina.Tomcat9CommitSessionOutputBuffer.doWrite(Tomcat9CommitSessionOutputBuffer.java:40)
                at org.apache.coyote.Response.doWrite(Response.java:601)
                at 
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:339)
                at 
org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:776)
                at 
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:298)
                at 
org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:251)
                at 
org.apache.catalina.connector.Response.finishResponse(Response.java:441)
                at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:374)
                at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
                at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
                at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
                at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)
                at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.base/java.lang.Thread.run(Thread.java:834)
   ```
   The context is null in this case, so the NPE is thrown attempting to get the 
Manager:
   ```
                                            final Context context = 
request.getContext();
   AbstractCommitSessionValve.java:63 ->    final Manager manager = 
context.getManager();
   ```


----------------------------------------------------------------
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.

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


> Session state not committed prior to servlet output flush with commit valve 
> enabled
> -----------------------------------------------------------------------------------
>
>                 Key: GEODE-8221
>                 URL: https://issues.apache.org/jira/browse/GEODE-8221
>             Project: Geode
>          Issue Type: Bug
>          Components: http session
>            Reporter: Jacob Barrett
>            Assignee: Jacob Barrett
>            Priority: Major
>
> The Tomcat session state module does not commit session data to Geode prior 
> to servlet output flushing to browser if commit valve is enabled. The commit 
> valve delays the commit of session state until the of the request scope prior 
> to closing and ending the current request with the browser. This can result 
> in some data being sent to the browser asynchronously with the session state 
> persistence. If the servlet or JSP invokes a flush on output stream, write or 
> response either explicitly through the flush method or implicitly because of 
> full buffers then the browser may receive data that instructs it to make 
> another request. This subsequent request may receive the currently committed 
> session state prior to the completion of the initial request. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to