difficulty getting a SessionInfoDumper to work

28 views
Skip to first unread message

harryh

unread,
Nov 6, 2009, 2:58:57 PM11/6/09
to Lift
Trying to get a SessionInfoDumper to work and having some troubles.

When running locally on production or staging I do see session
expiration messages in the log files, but never anything from the
SessionInfoDumper (which I copied directly from the example app).

When running locally on my dev box I don't see expiration message or
SessionInfoDumper messages (though the former could be because I've
never sat around for 30 mins waiting for a session to expire).
Looking at the code, it's unclear to me how the first CheckAndPurge
ever gets sent to SessionMaster. Given this confusion, if I add this
(thx to Jon Hoffman for coming up with this idea):

SessionMaster.getClass.getMethods.find(_.toString.contains
("doPing")).get.invoke(SessionMaster)

to Boot.scala, I do start to see logging messages from my
SessionInfoDumper.

So I'm fairly confused about what is going on here:

A) Is there something in this area where running in dev mode should be
different from when I run in production (inside of jetty)?
B) How, in fact, is that first CheckAndPurge message supposed to get
sent to SessionMaster?
C) Any ideas on why I might be getting Session expiration messages(1)
but nothing from my SessionInfoDumper when running in production?

-harryh

harryh

unread,
Nov 6, 2009, 4:45:59 PM11/6/09
to Lift
OK, I think I know what is going on here.

In production I'm still on M6, so it's non on lift actors yet. And I
forgot to start the SessionInfoDumper actor (doh!). So that explains
why I am seeing sessions get expired in prod, but never see any
messages from my SessionInfoDumper. Messages are getting sent to it,
but since it's never started, it's not processing them.

OK, and in Dev I'm on M7. And I am now convinced that there is a bug
introduced in M7 where no CheckAndPurge message is ever sent to
SessionMaster so it will never purge expired sessions or send messages
to sessionWatchers. I've looked back at the M6 code and I see how
everything starts up correctly, but in M7 it looks no good.

This seems like a moderately serious bug. For now I'm adding:

SessionMaster.getClass.getMethods.find(_.toString.contains
("doPing")).get.invoke(SessionMaster)

to my Boot.scala to get around it. Others using M7 may want to do the
same (pending confirmation from dpp that I have correctly analyzed the
situation).

-harryh

David Pollak

unread,
Nov 10, 2009, 7:34:07 PM11/10/09
to lif...@googlegroups.com
Yeah, the LiftSession initial pinger didn't get started.  This is the second serious defect in M7 (the other being #164).

We're mulling doing an M7A that resolves these issues.
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
Reply all
Reply to author
Forward
0 new messages