we discussed it and maybe there is a way by using the life cycle event of
the wicket servlet/filter..

When we get a clean shutdown we then just write a file to disk.
and the wicket load we read that file in and delete it again.

If there is no file it was a hard kill, and we can delete the pagestore
files.

Then i hope that the life cycle events works always when you shutdown the
complete container
or undeploy/redeploy the webapplication in a live system.

johan



On Nov 14, 2007 9:21 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:

> i don't get this picture. What do you mean with a PageStore thread touches
> this
> file every 5 minutes? What does that bring us? Why can it suddenly remove
> files?
> Because yes the previous page store isn't there anymore, the server did
> restart
> so the file isn't being touched. and then what? Why can't it delete?
>
> Again it a PageStore is not leading, yes it creates the files but it has
> no way to know
> if it can delete it, The only possible way i could think of if there was
> an API in the servlet
> spec for example on the context where i could ask for all the live session
> ids.
> That would be the only way to do it.
>
> An unique file or unique id its still the same, there is nothing unique
> about a pagestore
> a page store from process B can or must be able to read files in from a
> previous process B
> that doesnt matter. There is no automatic way, it has to be configured for
> deployment
> wicket can't assume anything.
>
> But still i am also not conviced that wicket needs to do this by a thread.
> We just have to document
> it then there must be a cleanup processs or scheduler if the server does
> crash or is not terminated gracefully.
> We could introduce such a thread in wicket if users really see the need
> for it.
>
> johan
>
>
> On Nov 14, 2007 8:25 PM, Chris Lintz <[EMAIL PROTECTED]> wrote:
>
> >
> > There are still other ways around this.  If every process registered
> > itself
> > via unique file in a known directory and a Page Store thread touched
> > this
> > file every say 5 minutes, this gives more information to a thread to
> > know
> > whether or not delete a Page Store directory associated with unique ID.
> >
> > For example,
> >
> > MyWebSite-filestore/running_processes/uid1
> > MyWebSite-filestore/running_processes/uid2
> > MyWebSite-filestore/running_processes/uid2
> >
> > Each Page store thread would then check the uid files that it did not
> > create.  For example, process 1 would check to see if uid1 and uid2 have
> >
> > been touched in the last hour (just making up something way greater than
> > 5
> > minutes).  If not, remove their associated PageStore files.
> >
> > I will admit this is a bit more involved, but i am trying to present a
> > solution that doesn't require any configuration from a user perspective.
> >
> >
> >
> >
> > Johan Compagner wrote:
> > >
> > > no it doesnt matter what id i generate or get. This is still not
> > > enough because it doesnt say any thing if i can delete it or not. i
> > > have an id 1 then i restart and i have id 2 can i then delete
> > > everything from 1? No i cant because there could be live sessions from
> > > 1.
> > >
> > > On 11/14/07, Chris Lintz <[EMAIL PROTECTED]> wrote:
> > >>
> > >> The process ID is just an idea for a unique ID.  If that wont work
> > for
> > >> you,
> > >> lets dream another unique ID .
> > >>
> > >>
> > >>
> > >> Johan Compagner wrote:
> > >> >
> > >> > ohh wait that also doesn't work (process id can also be generated
> > once
> > >> > ofcourse) but you can have mulitply dirs created with 10 different
> > >> > processes that are all valid. so that doesn't solve anything
> > >> >
> > >> > On 11/14/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > >> >> can you get the current process id by general api in java? have to
> >
> > >> >> look at Runtime then.
> > >> >>
> > >> >> On 11/14/07, Chris Lintz <[EMAIL PROTECTED]> wrote:
> > >> >> >
> > >> >> > That makes sense.  Another thought that possibly makes it a bit
> > >> easier
> > >> >> is
> > >> >> to
> > >> >> > name the page store directories with a unique process
> > identifier.
> > >> For
> > >> >> > example, if my session ID is B31598D4B206B75161AFE08FB5610D54.n1and
> > >> >> the
> > >> >> > process ID is 123456, then the Page store directory would be:
> > >> >> >
> > >> >> >
> >  MyWebSite-filestore/123456/B31598D4B206B75161AFE08FB5610D54.n1
> > >> >> >
> > >> >> > With a structure like that it would be easy for a thread to
> > remove
> > >> the
> > >> >> Page
> > >> >> > store directories that do not have the current process ID.
> > >> >> >
> > >> >> > Just a thought.
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> > Johan Compagner wrote:
> > >> >> > >
> > >> >> > > Yes the pagestore knows which files it makes, but it is not
> > the
> > >> >> controller
> > >> >> > > of those files
> > >> >> > > because the only thing that controls if the file must be
> > deleted
> > >> or
> > >> >> not
> > >> >> is
> > >> >> > > the servlet container
> > >> >> > > with the session objects.
> > >> >> > >
> > >> >> > > and as far as i know there is no api where i can ask which
> > >> sessions
> > >> >> are
> > >> >> > > still active.
> > >> >> > > So the only thing we could do is have a thread running that is
> > >> waking
> > >> >> up
> > >> >> > > every day once
> > >> >> > > and checks if there are files older then X. And that thread
> > must
> > >> be
> > >> >> > > configured by you
> > >> >> > > explicitly setting the timeout that you want to have.
> > >> >> > >
> > >> >> > > johan
> > >> >> > >
> > >> >> > >
> > >> >> > >
> > >> >> > >
> > >> >> > > On Nov 14, 2007 12:04 AM, Chris Lintz
> > >> <[EMAIL PROTECTED]>
> > >> >> > > wrote:
> > >> >> > >
> > >> >> > >>
> > >> >> > >> I think from previous threads there was discussion about
> > >> something
> > >> >> that
> > >> >> > >> you
> > >> >> > >> could do.  For instance, the Page store should know what
> > cache
> > >> files
> > >> >> it
> > >> >> > >> is
> > >> >> > >> controlling.  By that logic alone it can deduce what it is no
> > >> longer
> > >> >> > >> referencing and cleanup what was left form it.
> > >> >> > >>
> > >> >> > >> It seems silly to me to ask people to rely on graceful
> > restarts
> > >> or
> > >> >> write
> > >> >> > >> your own cleanup script from a framework that created cache
> > >> files.
> > >> >> It
> > >> >> > >> seems
> > >> >> > >> fairly standard to ask "clean up what was yours."   I'd like
> > to
> > >> hear
> > >> >> > >> other
> > >> >> > >> input from average users.
> > >> >> > >>
> > >> >> > >>
> > >> >> > >>
> > >> >> > >> Johan Compagner wrote:
> > >> >> > >> >
> > >> >> > >> > as long as your server doesn't crash and isn't terminate by
> > a
> > >> kill
> > >> >> -9
> > >> >> > >> > no files are leaked..
> > >> >> > >> >
> > >> >> > >> > When that does happen then yes you have to clean it up.
> > >> >> > >> > If you dont care about those files after a restart then in
> > the
> > >> >> script
> > >> >> > >> that
> > >> >> > >> > starts your webcontainer
> > >> >> > >> > you will just remove all the files in the work dir.
> > >> >> > >> >
> > >> >> > >> > I don't think wicket can do much about it.
> > >> >> > >> >
> > >> >> > >> > johan
> > >> >> > >> >
> > >> >> > >> >
> > >> >> > >> > On Nov 13, 2007 10:41 PM, Chris Lintz
> > >> >> <[EMAIL PROTECTED] >
> > >> >> > >> > wrote:
> > >> >> > >> >
> > >> >> > >> >>
> > >> >> > >> >> All,
> > >> >> > >> >> I have submitted a Jira on this topic.  I will leave it to
> > the
> > >> >> great
> > >> >> > >> >> minds
> > >> >> > >> >> to debate.  In any case, it appears restarting the
> > container
> > >> >> cannot
> > >> >> > >> >> notify
> > >> >> > >> >> the HttpSessionListeners that are bound to the page store
> > >> files.
> > >> >> It
> > >> >> > >> >> would
> > >> >> > >> >> be nice if the framework can cleanup what I consider a
> > leak of
> > >> >> the
> > >> >> > >> cache
> > >> >> > >> >> files it created.  Otherwise folks like myself living in
> > an
> > >> high
> > >> >> > >> traffic
> > >> >> > >> >> site are forced to generate script look for old page store
> > >> cache
> > >> >> > >> files.
> > >> >> > >> >>
> > >> >> > >> >> https://issues.apache.org/jira/browse/WICKET-1158
> > >> >> > >> >>
> > >> >> > >> >>
> > >> >> > >> >> Johan Compagner wrote:
> > >> >> > >> >> >
> > >> >> > >> >> >>
> > >> >> > >> >> >> > And from top of my head there is no api to get all
> > the
> > >> >> current
> > >> >> > >> >> session
> > >> >> > >> >> >> id's
> > >> >> > >> >> >> > from
> > >> >> > >> >> >> > an instance when the instance does start up..
> > >> >> > >> >> >>
> > >> >> > >> >> >> But we could ditch ALL the directories it can find in
> > the
> > >> temp
> > >> >> > >> >> >> directory the page store uses when starting up, right?
> > >> >> > >> >> >>
> > >> >> > >> >> >
> > >> >> > >> >> > No we can't do that, If you as you should terminate your
> > web
> > >> >> > >> container
> > >> >> > >> >> > gracefully
> > >> >> > >> >> > then the web container will save all the sessions to
> > disk.
> > >> Then
> > >> >> if
> > >> >> > >> you
> > >> >> > >> >> > restart it again
> > >> >> > >> >> > all the sessions are loaded again. And yes the
> > application
> > >> >> works
> > >> >> > >> just
> > >> >> > >> >> as
> > >> >> > >> >> > it was never
> > >> >> > >> >> > restarted. But if we throw away all the page stores.
> > Then we
> > >> >> loose
> > >> >> > >> all
> > >> >> > >> >> the
> > >> >> > >> >> > data
> > >> >> > >> >> > of sessions that are currently active.
> > >> >> > >> >> >
> > >> >> > >> >> > The only thing i can think of is having some check that
> > only
> > >> >> deletes
> > >> >> > >> >> > things
> > >> >> > >> >> > that are not touched for X hours or days.
> > >> >> > >> >> >
> > >> >> > >> >> > johan
> > >> >> > >> >> >
> > >> >> > >> >> >
> > >> >> > >> >>
> > >> >> > >> >> --
> > >> >> > >> >> View this message in context:
> > >> >> > >> >>
> > >> >> > >>
> > >> >> >
> > >> >>
> > >> http://www.nabble.com/How-To-Change-Page-Store-Size-in-DiskPageStore--tf4768072.html#a13735298
> >
> > >> >> > >> >> Sent from the Wicket - User mailing list archive at
> > >> >> > >> >> Nabble.com <http://nabble.com/> < http://nabble.com/><
> > http://nabble.com/>
> > >> >> > >> >> .
> > >> >> > >> >>
> > >> >> > >> >>
> > >> >> > >> >>
> > >> >>
> > ---------------------------------------------------------------------
> > >> >> > >> >>  To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > >> >> > >> >> For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >> >> > >> >>
> > >> >> > >> >>
> > >> >> > >> >
> > >> >> > >> >
> > >> >> > >>
> > >> >> > >> --
> > >> >> > >> View this message in context:
> > >> >> > >>
> > >> >> >
> > >> >>
> > >> http://www.nabble.com/How-To-Change-Page-Store-Size-in-DiskPageStore--tf4768072.html#a13736689
> >
> > >> >> > >>  Sent from the Wicket - User mailing list archive at
> > >> >> > >> Nabble.com <http://nabble.com/>< http://nabble.com/>
> > >> >> > >> .
> > >> >> > >>
> > >> >> > >>
> > >> >> > >>
> > >> >>
> > ---------------------------------------------------------------------
> > >> >> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> >> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >> >> > >>
> > >> >> > >>
> > >> >> > >
> > >> >> > >
> > >> >> >
> > >> >> > --
> > >> >> > View this message in context:
> > >> >> >
> > >> >>
> > >>
> > http://www.nabble.com/How-To-Change-Page-Store-Size-in-DiskPageStore--tf4768072.html#a13751284
> > >> >> > Sent from the Wicket - User mailing list archive at 
> > >> >> > Nabble.com<http://nabble.com/>
> > .
> > >> >> >
> > >> >> >
> > >> >> >
> > >> ---------------------------------------------------------------------
> > >> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> > >> >> >
> > >> >> >
> > >> >>
> > >> >
> > >> >
> > ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> > For additional commands, e-mail: [EMAIL PROTECTED]
> > >> >
> > >> >
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >>
> > http://www.nabble.com/How-To-Change-Page-Store-Size-in-DiskPageStore--tf4768072.html#a13753054
> > >> Sent from the Wicket - User mailing list archive at 
> > >> Nabble.com<http://nabble.com/>.
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > View this message in context: 
> > http://www.nabble.com/How-To-Change-Page-Store-Size-in-DiskPageStore--tf4768072.html#a13754524
> >
> >  Sent from the Wicket - User mailing list archive at 
> > Nabble.com<http://nabble.com/>
> > .
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to