Home page refreshing itself leads to OOME: enormous number of SessionInfos inside SessionMaster

43 views
Skip to first unread message

Dan Gravell

unread,
Apr 3, 2013, 4:58:47 AM4/3/13
to lif...@googlegroups.com
Hi. I use Lift (2.4) in my software and a user got in touch saying the Lift-powered web interface would not allow him to navigate about - the front page just kept refreshing itself.

This software is software that you install locally in the user's environment (in this case OS X). Of the 1000s of downloads per month, this is the first time I've seen this.

I did some screen sharing with him and confirmed the issue. The front page (which contains comet actors) just repeatedly reloads, on all browsers (well, just Safari and FF tried). Eventually, when leaving the browser refreshing, we got an OOME.

I took a look inside the resulting heap dump and it was dominated by a SessionMaster object holding 6754 SessionInfo objects. There's only one browser client and one user accessing this server, so I would actually expect just one HTTP session.

Each SessionInfo object looks pretty similar:

userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, like Gecko) Version/5.1.8 Safari/534.58.2
ipAddress: 127.0.0.1
session: [can be reproduced if required)

I tried restarting, same thing happens. Has anyone seen this before?

Dan

Alexandre Russel

unread,
Apr 3, 2013, 5:10:25 AM4/3/13
to lif...@googlegroups.com
Hi. I use Lift (2.4) in my software and a user got in touch saying the Lift-powered web interface would not allow him to navigate about - the front page just kept refreshing itself.

with safari, chrome and FF ? 

Jeppe Nejsum Madsen

unread,
Apr 3, 2013, 5:46:50 AM4/3/13
to lif...@googlegroups.com

Perhaps cookies are disabled or not correctly configured. This will create a new session for each request.....

/Jeppe

David Pollak

unread,
Apr 3, 2013, 11:27:48 AM4/3/13
to lif...@googlegroups.com
I think the refresh problem is a cookie problem. Can't solve it in Lift.

However, the OOME problem can be addressed. The demo.liftweb.nethttps://github.com/lift/examples/tree/master/combo/example ) code contains a session management tool that will reduce memory backpressure by deleting sessions that only have 1 request associated with them. You can see the code around https://github.com/lift/examples/blob/master/combo/example/src/main/scala/bootstrap/liftweb/Boot.scala#L311 and in SessionChecker.scala

Hope this helps.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Dan Gravell

unread,
Apr 3, 2013, 11:38:16 AM4/3/13
to lif...@googlegroups.com
Thanks all. I'll check back with the user. Is there anything subtle I can look at in the HTTP request to check what the status of cookies are, or is it simply a case of checking for the absence of said cookies?

Dan

David Pollak

unread,
Apr 3, 2013, 11:47:41 AM4/3/13
to lif...@googlegroups.com
On Wed, Apr 3, 2013 at 8:38 AM, Dan Gravell <elstens...@googlemail.com> wrote:
Thanks all. I'll check back with the user. Is there anything subtle I can look at in the HTTP request to check what the status of cookies are, or is it simply a case of checking for the absence of said cookies?

Look at the logs for the jsessionid cookie. If it changes between requests, we'll have our culprit.
 

Dan

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Gravell

unread,
Apr 4, 2013, 4:59:07 AM4/4/13
to lif...@googlegroups.com
I did some more screen sharing today with the user and made some more interesting discoveries.

Everything works fine with Google Chrome, but still with FF and Safari the refreshing problem occurs.

Using the Network diagnostics in Chrome I could see the cookie information passed back from the first visit to the page and then sent back from client to server in the jsessionid parameter.

The user has no security software (he knows of) and cookies are fully enabled.

Any more ideas, because I'd like to have this working in the other browsers for him (although it's good that Chrome is a workaround).

Dan

Jeppe Nejsum Madsen

unread,
Apr 4, 2013, 5:10:03 AM4/4/13
to lif...@googlegroups.com
On Thu, Apr 4, 2013 at 10:59 AM, Dan Gravell <elstens...@googlemail.com> wrote:
I did some more screen sharing today with the user and made some more interesting discoveries.

Everything works fine with Google Chrome, but still with FF and Safari the refreshing problem occurs.

Using the Network diagnostics in Chrome I could see the cookie information passed back from the first visit to the page and then sent back from client to server in the jsessionid parameter.


The interesting part is if the same jsessionid cookie value is sent on subsequent requests (in the browsers that don't work)....

/jeppe

Antonio Salazar Cardozo

unread,
Apr 5, 2013, 3:34:59 PM4/5/13
to lif...@googlegroups.com
Are you using comet requests on the page? What interaction is causing the reload? Is the server sending down a location.reload? Or is it something else?
Thanks,
Antonio

Dan Gravell

unread,
Apr 8, 2013, 6:44:05 AM4/8/13
to lif...@googlegroups.com
Yep, comet actors on the page. Simply visiting the page is causing the reload. Not sure on what the server is sending because I wasn't able to gather more details from the FF/Safari instances. Until I can do this, consider this parked.

Antonio Salazar Cardozo

unread,
Apr 8, 2013, 2:41:28 PM4/8/13
to lif...@googlegroups.com
I would consider attaching a responseTransformer to all requests that logs the request content. That should let you see what the server is trying to send.

Amongst other things, try setting:

LiftRules.noAjaxSessionCmd.default.set(() => JsCmds.Alert("Uh-oh, no ajax session!"))
LiftRules.noCometSessionCmd.default.set(() => JsCmds.Alert("Uh-oh, no comet session!"))

And see what you get.
Thanks,
Antonio
Reply all
Reply to author
Forward
0 new messages