Re: [jetty-users] Sessions are not invalidated at shutdown any longer

2020-05-28 Thread Dirk Olmes
On 5/28/20 1:58 PM, Jan Bartel wrote:
> Dirk,
> 
> I think you're spot on here: I do remember changing my mind about whether a
> session data store could be null or not. I've raised an issue for that:
> https://github.com/eclipse/jetty.project/issues/4920

Thanks for the confirmation, Jan.

-dirk

___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Sessions are not invalidated at shutdown any longer

2020-05-28 Thread Jan Bartel
Dirk,

I think you're spot on here: I do remember changing my mind about whether a
session data store could be null or not. I've raised an issue for that:
https://github.com/eclipse/jetty.project/issues/4920

Cheers
Jan

On Thu, 28 May 2020, 12:36 Dirk Olmes,  wrote:

> On 5/28/20 11:08 AM, Jan Bartel wrote:
> > Sounds like you need the NullSessionDataStore:
> >
> https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java
>
> ... whis is active by default, yes.
>
> But then in DefaultSessionCache's shutdown method the _sessionDataStore
> is not null and the else branch will not be executed, i.e. the sessions
> will not be invalidated as they are "stored" by the NullSessionDataStore.
>
> IMHO the code is inconsistent here: some parts of AbstractSessionCache
> assume that there is a _sessionDataStore (e.g. doStop(), commit(Session)
> etc.) and some parts are safely guarded with null checks.
> DefaultSessionCache suggests that it's OK to have no _sessionDataStore ...
>
> I imagine I could hack together a subclass of DefaultSessionCache, grab
> the sessions and invalidate them manually but I think a proper fix in
> the Jetty codebase would be better.
>
> -dirk
>
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Sessions are not invalidated at shutdown any longer

2020-05-28 Thread Dirk Olmes
On 5/28/20 11:08 AM, Jan Bartel wrote:
> Sounds like you need the NullSessionDataStore:
> https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java

... whis is active by default, yes.

But then in DefaultSessionCache's shutdown method the _sessionDataStore
is not null and the else branch will not be executed, i.e. the sessions
will not be invalidated as they are "stored" by the NullSessionDataStore.

IMHO the code is inconsistent here: some parts of AbstractSessionCache
assume that there is a _sessionDataStore (e.g. doStop(), commit(Session)
etc.) and some parts are safely guarded with null checks.
DefaultSessionCache suggests that it's OK to have no _sessionDataStore ...

I imagine I could hack together a subclass of DefaultSessionCache, grab
the sessions and invalidate them manually but I think a proper fix in
the Jetty codebase would be better.

-dirk

___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Sessions are not invalidated at shutdown any longer

2020-05-28 Thread Jan Bartel
Sounds like you need the NullSessionDataStore:
https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java

Jan

On Thu, 28 May 2020 at 08:17, Dirk Olmes  wrote:

> Hi,
>
> I'm using an embedded Jetty for our web application. A long time ago we
> have tied our usage checks to http sessions. This makes use of the fact
> that all sessions are properly invalidated when the server shuts down.
>
> I have revisited this topic again now and I'm seeing that the http
> sessions are no longer invalidated when the server shuts down. Digging
> into DefaultSessionCache's shutdown method I see that to get proper
> session invalidation I should not use a SessionDataStore
> (
> https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java#L143
> ).
>
> At the same time it seems I cannot go without a SessionDataStore as
> AbstractSessionCache's doStart method insists on using one
> (
> https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java#L203
> ).
>
> Is this inconsistency expected? How would I code my way around it?
>
> -dirk
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>


-- 
Jan Bartel 
www.webtide.com
*Expert assistance from the creators of Jetty and CometD*
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


[jetty-users] Sessions are not invalidated at shutdown any longer

2020-05-28 Thread Dirk Olmes
Hi,

I'm using an embedded Jetty for our web application. A long time ago we
have tied our usage checks to http sessions. This makes use of the fact
that all sessions are properly invalidated when the server shuts down.

I have revisited this topic again now and I'm seeing that the http
sessions are no longer invalidated when the server shuts down. Digging
into DefaultSessionCache's shutdown method I see that to get proper
session invalidation I should not use a SessionDataStore
(https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java#L143).

At the same time it seems I cannot go without a SessionDataStore as
AbstractSessionCache's doStart method insists on using one
(https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java#L203).

Is this inconsistency expected? How would I code my way around it?

-dirk
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users