Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Possible typo in MongoSessionManager

Hi Denis,

I don't think there's a specific test for this. As far as I can see,
the code is handling the situation where a session has been updated by
another node. This would imply that the session is in use by 2 nodes
at once, or that the session has bounced around from node-to-node
which is not something desirable anyway - usually load balancers will
direct all requests to a single node until that node fails.  Perhaps
there is another scenario you have experienced?

As regards a test, if you wanted to have a go at writing a test for
it, basing it off the other tests in test-sessions-common, or the
specific tests we have in test-jdbc-sessions or test-mongo-sessions,
then it would be great if you would contribute it to the project.

cheers
Jan

On 19 February 2014 21:52, Denis Bardadym <bardadymchik@xxxxxxxxx> wrote:
> Hi Jan,
>
> Thanks for update. Yes now this place looks right.
> Do you know if test-sessions-common project contains some test for this
> thing?
>
> Thanks, Denis
>
> На 19 февраля 2014 г. в 8:07:45, Jan Bartel (janb@xxxxxxxxxxx) написал:
>
> Hi Denis,
>
> Your email prompted me to look back at the issue where that region of
> code was touched last:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=373952
>
> It seems to me that the original bug raiser's concerns weren't
> addressed, and are in the same region of code as you point out. So I
> reopened the original issue, and took another stab at fixing it.
>
> I've attached the diff of the change I made here - could you take a
> look at it and tell me if you think it's good? Note that the biggest
> change is that unbind will not be called automatically for all
> attributes if a session needs to be refreshed; if an attribute is
> present in both the original session, and the update from disk, then
> the value of the existing one is replaced with the one from the update
> but bind will *NOT* be called - I think this is the crux of the
> original bug.
>
> thanks
> Jan
>
> On 15 February 2014 04:17, Denis Bardadym <bardadymchik@xxxxxxxxx> wrote:
>> Hello.
>>
>> I am sorry if i wrote to wrong mailing list. I am porting nosql sessions
>> to
>> redis, and while looking sources for mongo, i found:
>>
>> On line 375
>>
>> (http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java#n375)
>> it traverse by attribute keys that we load from mongo,
>>
>> for (String name : attrs.keySet())
>>
>>
>> then on line 384
>>
>> (http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java#n384)
>>
>> if (attrs.keySet().contains(name))
>>
>> which inside this cycle always true. It looks like there is a typo, and
>> really should be session.getNames(). I am understand this right?
>>
>> Thanks, Denis Bardadym
>>
>>
>> _______________________________________________
>> jetty-dev mailing list
>> jetty-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>
>
>
>
> --
> Jan Bartel <janb@xxxxxxxxxxx>
> www.webtide.com
> 'Expert Jetty/CometD developer,production,operations advice'
> ________________________________
> _______________________________________________
> jetty-dev mailing list
> jetty-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-dev



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


Back to the top