[jira] [Commented] (WICKET-6848) Session invalidation fails because response is already committed

2020-11-14 Thread Sven Meier (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232182#comment-17232182
 ] 

Sven Meier commented on WICKET-6848:


Changes are pushed to master and 8.x now, please take another look and run your 
tests.

> Session invalidation fails because response is already committed
> 
>
> Key: WICKET-6848
> URL: https://issues.apache.org/jira/browse/WICKET-6848
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 9.1.0, 8.10.0
>Reporter: Emond Papegaaij
>Assignee: Emond Papegaaij
>Priority: Major
> Fix For: 9.2.0, 8.11.0
>
> Attachments: 
> WICKET-6848-invalidate-session-manager-immediately.patch, WICKET-6848.diff, 
> wicket6848.zip
>
>
> Since Wicket 9.1.0, we are seeing the stacktrace below. It is very likely 
> related to the changes made with WICKET-6831. We are currently checking if 
> this has been fixed by the latest changes on master, but I believe this is a 
> different issue.
> From the stacktrace I deduce that the session is invalidated as part of 
> detach, but as detach is now called after flush, it is no longer possible to 
> invalidate the HttpSession at this point (you cannot clear the JSESSIONID 
> cookie).
> {code}
> 17:22:11,823 ERROR [io.undertow.request] (default task-9) UT005023: Exception 
> handling request to /idp/: java.lang.IllegalStateException: WFLYCLWEBUT0009: 
> Invalidation attempted for session JtkqV0MvzZq-RzFBSs-K6n2CcJN72IDooNHsTBm8 
> after the response was committed (e.g. after HttpServletResponse.sendRedirect 
> or sendError)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.validateBatch(DistributableSession.java:292)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:225)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:198)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.session.HttpSessionStore.invalidate(HttpSessionStore.java:165)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.destroy(Session.java:508)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.invalidateNow(Session.java:529)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.detach(Session.java:684)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:674)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:614)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:284)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:207)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:306)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> deployment.parnassys-portal-authenticator.war//nl.topicus.cobra.filter.ClickjackFilter.doFilter(ClickjackFilter.java:29)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
>   at 
> org.wildfly.extension.undertow@20.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
>   at 
> 

[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread Sven Meier (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232181#comment-17232181
 ] 

Sven Meier commented on WICKET-6847:


Changes are pushed to master and 8.x now, please take another look and run your 
tests.

> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Updated] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread Sven Meier (Jira)


 [ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sven Meier updated WICKET-6847:
---
Fix Version/s: 8.11.0

> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0, 8.11.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232180#comment-17232180
 ] 

ASF subversion and git services commented on WICKET-6847:
-

Commit 65e5ceab7498d9dec73e50d3d4cfd01302dd64de in wicket's branch 
refs/heads/master from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=65e5cea ]

WICKET-6847 small optimization


> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232178#comment-17232178
 ] 

ASF subversion and git services commented on WICKET-6847:
-

Commit 0cb3d6798f4056352c8214ade49fe5fd5947e5c9 in wicket's branch 
refs/heads/master from Emond Papegaaij
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=0cb3d67 ]

WICKET-6847: swap listeners and RequestCycle onEndRequest

This makes sure the session is destroyed (when needed) after the page
store handles the touched pages. This latter action can create a new
session if it was destroyed before, causing logout to fail.


> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232179#comment-17232179
 ] 

ASF subversion and git services commented on WICKET-6847:
-

Commit 2feed893069031f5d6e2a9353e73dae06f61864c in wicket's branch 
refs/heads/master from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=2feed89 ]

WICKET-6847 clear pages in invalidateNow()

otherwise they will be stored on detach when no session is available and 
response already committed


> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Commented] (WICKET-6848) Session invalidation fails because response is already committed

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232177#comment-17232177
 ] 

ASF subversion and git services commented on WICKET-6848:
-

Commit 0c81a8830480d8aa57f3d45f7c6d1ea74b5b4bad in wicket's branch 
refs/heads/master from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=0c81a88 ]

WICKET-6848 sessionInvalidation before flush


> Session invalidation fails because response is already committed
> 
>
> Key: WICKET-6848
> URL: https://issues.apache.org/jira/browse/WICKET-6848
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 9.1.0, 8.10.0
>Reporter: Emond Papegaaij
>Assignee: Emond Papegaaij
>Priority: Major
> Fix For: 9.2.0, 8.11.0
>
> Attachments: 
> WICKET-6848-invalidate-session-manager-immediately.patch, WICKET-6848.diff, 
> wicket6848.zip
>
>
> Since Wicket 9.1.0, we are seeing the stacktrace below. It is very likely 
> related to the changes made with WICKET-6831. We are currently checking if 
> this has been fixed by the latest changes on master, but I believe this is a 
> different issue.
> From the stacktrace I deduce that the session is invalidated as part of 
> detach, but as detach is now called after flush, it is no longer possible to 
> invalidate the HttpSession at this point (you cannot clear the JSESSIONID 
> cookie).
> {code}
> 17:22:11,823 ERROR [io.undertow.request] (default task-9) UT005023: Exception 
> handling request to /idp/: java.lang.IllegalStateException: WFLYCLWEBUT0009: 
> Invalidation attempted for session JtkqV0MvzZq-RzFBSs-K6n2CcJN72IDooNHsTBm8 
> after the response was committed (e.g. after HttpServletResponse.sendRedirect 
> or sendError)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.validateBatch(DistributableSession.java:292)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:225)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:198)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.session.HttpSessionStore.invalidate(HttpSessionStore.java:165)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.destroy(Session.java:508)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.invalidateNow(Session.java:529)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.detach(Session.java:684)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:674)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:614)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:284)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:207)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:306)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> deployment.parnassys-portal-authenticator.war//nl.topicus.cobra.filter.ClickjackFilter.doFilter(ClickjackFilter.java:29)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
>   at 
> 

[jira] [Commented] (WICKET-6848) Session invalidation fails because response is already committed

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232175#comment-17232175
 ] 

ASF subversion and git services commented on WICKET-6848:
-

Commit a1c94760fdaf5769211c47edfd1a4ac6077e998f in wicket's branch 
refs/heads/wicket-8.x from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=a1c9476 ]

WICKET-6847 WICKET-6848 flush before detach fixes


> Session invalidation fails because response is already committed
> 
>
> Key: WICKET-6848
> URL: https://issues.apache.org/jira/browse/WICKET-6848
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 9.1.0, 8.10.0
>Reporter: Emond Papegaaij
>Assignee: Emond Papegaaij
>Priority: Major
> Fix For: 9.2.0, 8.11.0
>
> Attachments: 
> WICKET-6848-invalidate-session-manager-immediately.patch, WICKET-6848.diff, 
> wicket6848.zip
>
>
> Since Wicket 9.1.0, we are seeing the stacktrace below. It is very likely 
> related to the changes made with WICKET-6831. We are currently checking if 
> this has been fixed by the latest changes on master, but I believe this is a 
> different issue.
> From the stacktrace I deduce that the session is invalidated as part of 
> detach, but as detach is now called after flush, it is no longer possible to 
> invalidate the HttpSession at this point (you cannot clear the JSESSIONID 
> cookie).
> {code}
> 17:22:11,823 ERROR [io.undertow.request] (default task-9) UT005023: Exception 
> handling request to /idp/: java.lang.IllegalStateException: WFLYCLWEBUT0009: 
> Invalidation attempted for session JtkqV0MvzZq-RzFBSs-K6n2CcJN72IDooNHsTBm8 
> after the response was committed (e.g. after HttpServletResponse.sendRedirect 
> or sendError)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.validateBatch(DistributableSession.java:292)
>   at 
> org.wildfly.clustering.web.undertow@20.0.1.Final//org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:225)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:198)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.session.HttpSessionStore.invalidate(HttpSessionStore.java:165)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.destroy(Session.java:508)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.invalidateNow(Session.java:529)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.Session.detach(Session.java:684)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:674)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:614)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:284)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:207)
>   at 
> deployment.parnassys-portal-authenticator.war//org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:306)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> deployment.parnassys-portal-authenticator.war//nl.topicus.cobra.filter.ClickjackFilter.doFilter(ClickjackFilter.java:29)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
>   at 
> io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
>   at 
> 

[wicket] branch master updated (a459a53 -> 65e5cea)

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git.


from a459a53  Update Spring to 5.3.1 and Jetty to 9.4.34
 new b4e4658  WICKET-6847 onEndRequest before flush
 new 0c81a88  WICKET-6848 sessionInvalidation before flush
 new 0cb3d67  WICKET-6847: swap listeners and RequestCycle onEndRequest
 new 2feed89  WICKET-6847 clear pages in invalidateNow()
 new 65e5cea  WICKET-6847 small optimization

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml| 12 ++
 .../main/java/org/apache/wicket/Application.java   |  6 +++
 .../src/main/java/org/apache/wicket/Session.java   | 45 +-
 .../java/org/apache/wicket/page/IPageManager.java  |  6 +++
 .../java/org/apache/wicket/page/PageManager.java   |  6 +++
 .../wicket/pageStore/DelegatingPageStore.java  |  6 +++
 .../org/apache/wicket/pageStore/IPageStore.java|  9 +
 .../apache/wicket/pageStore/RequestPageStore.java  | 22 ---
 .../apache/wicket/protocol/http/WicketFilter.java  |  8 +---
 .../apache/wicket/request/cycle/RequestCycle.java  | 24 +++-
 .../wicket/protocol/http/SessionDestroyTest.java   | 12 +++---
 11 files changed, 101 insertions(+), 55 deletions(-)



[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232176#comment-17232176
 ] 

ASF subversion and git services commented on WICKET-6847:
-

Commit b4e4658efa10ff08019158fa0f24de6cbebacbcc in wicket's branch 
refs/heads/master from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=b4e4658 ]

WICKET-6847 onEndRequest before flush

allows RequestPageStore to check for stateful pages


> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[wicket] 03/05: WICKET-6847: swap listeners and RequestCycle onEndRequest

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 0cb3d6798f4056352c8214ade49fe5fd5947e5c9
Author: Emond Papegaaij 
AuthorDate: Wed Nov 11 16:21:19 2020 +0100

WICKET-6847: swap listeners and RequestCycle onEndRequest

This makes sure the session is destroyed (when needed) after the page
store handles the touched pages. This latter action can create a new
session if it was destroyed before, causing logout to fail.
---
 .../src/main/java/org/apache/wicket/request/cycle/RequestCycle.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java 
b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
index 2c0a8c7..33d1335 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
@@ -263,8 +263,8 @@ public class RequestCycle implements IRequestCycle, 
IEventSink, IMetadataContext
{
try
{
-   onEndRequest();
listeners.onEndRequest(this);
+   onEndRequest();
}
catch (RuntimeException e)
{



[wicket] 04/05: WICKET-6847 clear pages in invalidateNow()

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 2feed893069031f5d6e2a9353e73dae06f61864c
Author: Sven Meier 
AuthorDate: Wed Nov 11 18:58:43 2020 +0100

WICKET-6847 clear pages in invalidateNow()

otherwise they will be stored on detach when no session is available and 
response already committed
---
 wicket-core/src/main/java/org/apache/wicket/Session.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java 
b/wicket-core/src/main/java/org/apache/wicket/Session.java
index 76f339c..9906da1 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Session.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Session.java
@@ -526,6 +526,9 @@ public abstract class Session implements IClusterable, 
IEventSink, IMetadataCont
invalidate();
}

+   // clear all pages possibly pending in the request
+   getPageManager().clear();
+   
destroy();
feedbackMessages.clear();
setStyle(null);



[wicket] 01/05: WICKET-6847 onEndRequest before flush

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit b4e4658efa10ff08019158fa0f24de6cbebacbcc
Author: Sven Meier 
AuthorDate: Fri Nov 6 18:36:16 2020 +0100

WICKET-6847 onEndRequest before flush

allows RequestPageStore to check for stateful pages
---
 pom.xml  | 12 
 .../src/main/java/org/apache/wicket/Application.java |  6 ++
 .../java/org/apache/wicket/page/IPageManager.java|  6 ++
 .../java/org/apache/wicket/page/PageManager.java |  6 ++
 .../apache/wicket/pageStore/DelegatingPageStore.java |  6 ++
 .../java/org/apache/wicket/pageStore/IPageStore.java |  9 +
 .../apache/wicket/pageStore/RequestPageStore.java| 19 ++-
 .../apache/wicket/request/cycle/RequestCycle.java| 20 ++--
 8 files changed, 69 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2e63287..9d9e356 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1133,6 +1133,18 @@

9.0.0
true
true
+   
+   
+   
7012
+   
org/apache/wicket/page/IPageManager
+   void 
end()
+   
+   
+   
7012
+   
org/apache/wicket/pageStore/IPageStore
+   void 
end(org.apache.wicket.pageStore.IPageContext)
+   
+   



diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java 
b/wicket-core/src/main/java/org/apache/wicket/Application.java
index 78fd57f..fa4ce29 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Application.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Application.java
@@ -1567,6 +1567,12 @@ public abstract class Application implements 
UnboundListener, IEventSink, IMetad
requestCycle.getListeners().add(new IRequestCycleListener()
{
@Override
+   public void onEndRequest(RequestCycle cycle)
+   {
+   internalGetPageManager().end();
+   }
+   
+   @Override
public void onDetach(final RequestCycle requestCycle)
{
internalGetPageManager().detach();
diff --git a/wicket-core/src/main/java/org/apache/wicket/page/IPageManager.java 
b/wicket-core/src/main/java/org/apache/wicket/page/IPageManager.java
index c675cd9..ef6094a 100644
--- a/wicket-core/src/main/java/org/apache/wicket/page/IPageManager.java
+++ b/wicket-core/src/main/java/org/apache/wicket/page/IPageManager.java
@@ -73,6 +73,12 @@ public interface IPageManager
void clear();
 
/**
+* End the request.
+*/
+   default void end() {
+   }
+   
+   /**
 * Detach at end of request.
 */
void detach();
diff --git a/wicket-core/src/main/java/org/apache/wicket/page/PageManager.java 
b/wicket-core/src/main/java/org/apache/wicket/page/PageManager.java
index 642b3c1..02bf13c 100644
--- a/wicket-core/src/main/java/org/apache/wicket/page/PageManager.java
+++ b/wicket-core/src/main/java/org/apache/wicket/page/PageManager.java
@@ -80,6 +80,12 @@ public class PageManager implements IPageManager
}

@Override
+   public void end()
+   {
+   store.end(createPageContext());
+   }
+   
+   @Override
public void detach()
{
store.detach(createPageContext());
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/DelegatingPageStore.java
 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/DelegatingPageStore.java
index 5ec3a79..3402b2c 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/DelegatingPageStore.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/DelegatingPageStore.java
@@ -76,6 +76,12 @@ public abstract class DelegatingPageStore implements 
IPageStore
}

@Override
+   public void end(IPageContext context)
+  

[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232174#comment-17232174
 ] 

ASF subversion and git services commented on WICKET-6847:
-

Commit a1c94760fdaf5769211c47edfd1a4ac6077e998f in wicket's branch 
refs/heads/wicket-8.x from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=a1c9476 ]

WICKET-6847 WICKET-6848 flush before detach fixes


> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[wicket] 05/05: WICKET-6847 small optimization

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 65e5ceab7498d9dec73e50d3d4cfd01302dd64de
Author: Sven Meier 
AuthorDate: Wed Nov 11 19:10:26 2020 +0100

WICKET-6847 small optimization
---
 .../src/main/java/org/apache/wicket/pageStore/RequestPageStore.java| 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/RequestPageStore.java 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/RequestPageStore.java
index d5c4d78..c8034f5 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/RequestPageStore.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/RequestPageStore.java
@@ -89,6 +89,8 @@ public class RequestPageStore extends DelegatingPageStore
@Override
public void end(IPageContext context)
{
+   getDelegate().end(context);
+   
RequestData requestData = getRequestData(context);
for (IManageablePage page : requestData.pages())
{
@@ -96,6 +98,7 @@ public class RequestPageStore extends DelegatingPageStore
{
// last opportunity to create a session
context.getSessionId(true);
+   break;
}
}
}



[wicket] 02/05: WICKET-6848 sessionInvalidation before flush

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 0c81a8830480d8aa57f3d45f7c6d1ea74b5b4bad
Author: Sven Meier 
AuthorDate: Sat Nov 7 09:56:15 2020 +0100

WICKET-6848 sessionInvalidation before flush
---
 .../src/main/java/org/apache/wicket/Session.java   | 42 --
 .../apache/wicket/protocol/http/WicketFilter.java  |  8 +
 .../apache/wicket/request/cycle/RequestCycle.java  |  4 +++
 .../wicket/protocol/http/SessionDestroyTest.java   | 12 +++
 4 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java 
b/wicket-core/src/main/java/org/apache/wicket/Session.java
index 9d76c97..76f339c 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Session.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Session.java
@@ -557,24 +557,7 @@ public abstract class Session implements IClusterable, 
IEventSink, IMetadataCont
 */
public final boolean isSessionInvalidated()
{
-   RequestCycle requestCycle = RequestCycle.get();
-   return isSessionInvalidated(requestCycle);
-   }
-
-   /**
-* Whether the session is invalid now, or will be invalidated by the 
end of the request. Clients
-* should rarely need to use this method if ever.
-* 
-* @param requestCycle
-*The current request cycle
-* @return Whether the session is invalid when the current request is 
done
-* 
-* @see #invalidate()
-* @see #invalidateNow()
-*/
-   public static boolean isSessionInvalidated(RequestCycle requestCycle)
-   {
-   return 
Boolean.TRUE.equals(requestCycle.getMetaData(SESSION_INVALIDATED));
+   return 
Boolean.TRUE.equals(RequestCycle.get().getMetaData(SESSION_INVALIDATED));
}
 
/**
@@ -686,16 +669,9 @@ public abstract class Session implements IClusterable, 
IEventSink, IMetadataCont
}
 
/**
-* Any detach logic for session subclasses. This is called on the end 
of handling a request,
-* when the RequestCycle is about to be detached from the current 
thread.
+* End the current request.
 */
-   public void detach()
-   {
-   detachFeedback();
-
-   pageAccessSynchronizer.get().unlockAllPages();
-   RequestCycle.get().setMetaData(PAGES_UNLOCKED, true);
-
+   public void endRequest() {
if (isSessionInvalidated())
{
invalidateNow();
@@ -706,6 +682,18 @@ public abstract class Session implements IClusterable, 
IEventSink, IMetadataCont
updateId();
}
}
+   
+   /**
+* Any detach logic for session subclasses. This is called on the end 
of handling a request,
+* when the RequestCycle is about to be detached from the current 
thread.
+*/
+   public void detach()
+   {
+   detachFeedback();
+
+   pageAccessSynchronizer.get().unlockAllPages();
+   RequestCycle.get().setMetaData(PAGES_UNLOCKED, true);
+   }
 
private void detachFeedback()
{
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
index c6faaad..71f9d93 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
@@ -272,13 +272,11 @@ public class WicketFilter implements Filter
final FilterChain chain) throws IOException, ServletException
{
boolean reqProcessed;
-   boolean respFlushed = false;
try
{
reqProcessed = requestCycle.processRequest();
-   if (reqProcessed && 
!Session.isSessionInvalidated(requestCycle))
+   if (reqProcessed)
{
-   respFlushed = true;
webResponse.flush();
}
}
@@ -295,10 +293,6 @@ public class WicketFilter implements Filter
chain.doFilter(httpServletRequest, 
httpServletResponse);
}
}
-   else if (!respFlushed)
-   {
-   webResponse.flush();
-   }
return reqProcessed;
}
 
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java 
b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
index d913a92..2c0a8c7 100644
--- 

[wicket] branch wicket-8.x updated: WICKET-6847 WICKET-6848 flush before detach fixes

2020-11-14 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-8.x by this push:
 new a1c9476  WICKET-6847 WICKET-6848 flush before detach fixes
a1c9476 is described below

commit a1c94760fdaf5769211c47edfd1a4ac6077e998f
Author: Sven Meier 
AuthorDate: Mon Nov 9 21:48:30 2020 +0100

WICKET-6847 WICKET-6848 flush before detach fixes
---
 pom.xml|  7 
 .../main/java/org/apache/wicket/Application.java   |  6 +++
 .../src/main/java/org/apache/wicket/Session.java   | 40 --
 .../apache/wicket/page/AbstractPageManager.java|  5 +++
 .../java/org/apache/wicket/page/IPageManager.java  |  6 +++
 .../apache/wicket/page/PageManagerDecorator.java   |  5 +++
 .../org/apache/wicket/page/RequestAdapter.java | 48 +-
 .../apache/wicket/protocol/http/WicketFilter.java  |  8 +---
 .../request/cycle/IRequestCycleListener.java   |  2 +-
 .../apache/wicket/request/cycle/RequestCycle.java  | 24 ++-
 .../wicket/protocol/http/SessionDestroyTest.java   | 14 +++
 11 files changed, 105 insertions(+), 60 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1703d46..bad7ad6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1054,6 +1054,13 @@

8.0.0
true
true
+   
+   
+   
7012
+   
org/apache/wicket/page/IPageManager
+   void 
endRequest()
+   
+   



diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java 
b/wicket-core/src/main/java/org/apache/wicket/Application.java
index 5178f3b..ef6601a 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Application.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Application.java
@@ -1599,6 +1599,12 @@ public abstract class Application implements 
UnboundListener, IEventSink
requestCycle.getListeners().add(new IRequestCycleListener()
{
@Override
+   public void onEndRequest(RequestCycle cycle)
+   {
+   internalGetPageManager().endRequest();
+   }
+   
+   @Override
public void onDetach(final RequestCycle requestCycle)
{
if (Session.exists())
diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java 
b/wicket-core/src/main/java/org/apache/wicket/Session.java
index 066c2cb..6316f85 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Session.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Session.java
@@ -501,6 +501,7 @@ public abstract class Session implements IClusterable, 
IEventSink, IFeedbackCont
{

sessionStore.invalidate(RequestCycle.get().getRequest());
sessionStore = null;
+
id = null;
RequestCycle.get().setMetaData(SESSION_INVALIDATED, 
false);
clientInfo = null;
@@ -520,6 +521,9 @@ public abstract class Session implements IClusterable, 
IEventSink, IFeedbackCont
invalidate();
}

+   // clear all pages possibly pending in the request
+   getPageManager().clear();
+
destroy();
feedbackMessages.clear();
setStyle(null);
@@ -551,24 +555,7 @@ public abstract class Session implements IClusterable, 
IEventSink, IFeedbackCont
 */
public final boolean isSessionInvalidated()
{
-   RequestCycle requestCycle = RequestCycle.get();
-   return isSessionInvalidated(requestCycle);
-   }
-
-   /**
-* Whether the session is invalid now, or will be invalidated by the 
end of the request. Clients
-* should rarely need to use this method if ever.
-* 
-* @param requestCycle
-*The current request cycle
-* @return Whether the session is invalid when the current request is 
done
-* 
-* @see #invalidate()
-* @see #invalidateNow()
-*/
-   public static boolean isSessionInvalidated(RequestCycle 

[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread Emond Papegaaij (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232163#comment-17232163
 ] 

Emond Papegaaij commented on WICKET-6847:
-

Yes, this also affects 8.x.

> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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


[jira] [Commented] (WICKET-6847) async page storing fails with flush before detach without session

2020-11-14 Thread Andrea Del Bene (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17232051#comment-17232051
 ] 

Andrea Del Bene commented on WICKET-6847:
-

{quote}IMHO it would be good to release 9.2.0 ASAP (though we have no real 
hurry for this as only our master depends on 9.x and we have no release based 
on master soon). Thanks again for support.
{quote}
I will start the release as soon as the issue branch will be merged into 
master. BTW, does this issue also affect 8.x?

> async page storing fails with flush before detach without session
> -
>
> Key: WICKET-6847
> URL: https://issues.apache.org/jira/browse/WICKET-6847
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 9.1.0
>Reporter: Sven Meier
>Assignee: Martin Tzvetanov Grigorov
>Priority: Minor
> Fix For: 9.2.0
>
>
> Since WICKET-6831 the response is flushed before detach.
> RequestPageStore delays storing all of stateful pages until detach; at that 
> moment  AsynchronousPageStore can no longer acquire the required session id.



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