[jetty-dev] Tests for the Mongo session storage implementation?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Tests for the Mongo session storage implementation?

Christopher Exell
We've encountered a couple issues with the Mongo session storage implementation.

1. We are running into what appears be sessions being loaded as empty when  a browser is no longer stuck to single jetty instance with sticky load balancing.

2. Purging, and Scavenging cause the server to be unable to serve requests during purge/scavenge because of synchronization on the _sessionsIds Set.



I'd like to take a crack at investigating/fixing these issues, but I'm not finding any unit tests for the Mongo session storage implementation. Am I overlooking something, or do they need to be written. If they need to be written what are the jetty project's best practices for adding new tests that are dependent on a particular database?




_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Tests for the Mongo session storage implementation?

Jan Bartel-3
Hi Christopher,

You don't mention which version of jetty this is with?

As for using with non-sticky load balancing, this is always going to
be a problem for sessions, regardless of the particular persistence
technology. If a session is bouncing around between nodes, you can
never guarantee that any given node will have the up-to-date session
info.  In that scenario there will always be a window where its
possible that a node responds to a request with a session with old
info. The only way to fix that would be for a node to always reload
session data from the persistence mechanism on every request - which
would be prohibitively time consuming.  That said, I would expect the
session contents to be old, rather than empty, so this is probably
worth taking a peek at.

And as for unit tests, yes indeed they exist:
https://github.com/eclipse/jetty.project/tree/master/tests/test-sessions/test-mongodb-sessions

They are disabled for the usual jetty build because they require a
mongodb instance to be installed. However, you can comment out the
<skipTests> setting in the pom and run them with maven (or just run
them from your ide).

cheers,
Jan


On 25 March 2015 at 11:03, Christopher Exell
<[hidden email]> wrote:

> We've encountered a couple issues with the Mongo session storage
> implementation.
>
> 1. We are running into what appears be sessions being loaded as empty when
> a browser is no longer stuck to single jetty instance with sticky load
> balancing.
>
> 2. Purging, and Scavenging cause the server to be unable to serve requests
> during purge/scavenge because of synchronization on the _sessionsIds Set.
>
>
>
> I'd like to take a crack at investigating/fixing these issues, but I'm not
> finding any unit tests for the Mongo session storage implementation. Am I
> overlooking something, or do they need to be written. If they need to be
> written what are the jetty project's best practices for adding new tests
> that are dependent on a particular database?
>
>
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-dev



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev