[ 
https://issues.apache.org/jira/browse/WICKET-2357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Ertl updated WICKET-2357:
-------------------------------

    Attachment: WICKET-2357-1_4.patch
                WICKET-2357-1_3.patch

In order to implement a method of cleaning up expired / stale / orphaned 
DiskPageStore directories I would like to contribute the following methods to 
wicket:

DiskPageStore.getStoreFolder() --> convert from private to public

required to get access to the session folder for cleaning up purposes. also 
allows to override DiskPageStore and change the default location for serialized 
sessions.


File.deleteRecursively:

        /**
         * delete a file or directory including its files and subdirectories
         *
         * @return <code>true</code> if deletion was successful, 
<code>false</code> otherwise
         */

        public final boolean deleteRecursively()


required to wipe (expired) directories including it's content. also useful for 
any kind of file operation that requires killing a full directory with 
subdirectories.

File.lastModicationRecursively:

        /**
         * return the latest modification time of a file or a folder including 
its files and subfolders
         *
         * @return modification time in milliseconds or <code>0</code> if file 
doesn't exist or I/O error occurred
         */
        public long lastModificationRecursively()
        {
                return lastModificationRecursively(lastModified());
        }

returns the very last modification time of any file in a folder and below 
including the folder itself. this is helpful to determine the session folders 
that are older than for example one week in order to delete them. can be useful 
for any kind of disk caching to remove expired entries.

> (follow-up of WICKET-1158) DiskPageStore does not cleanup cache files after 
> Web container restarts
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2357
>                 URL: https://issues.apache.org/jira/browse/WICKET-2357
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Peter Ertl
>         Attachments: WICKET-2357-1_3.patch, WICKET-2357-1_4.patch
>
>
> in WICKET-1158 there was some talk about cleaning up stale pagemap files of 
> DiskPageStore on non-graceful container restarts (e.g. when doing kill -9). 
> Last comment stated this issue will be fixed when related WICKET-1161 is 
> fixed. However WICKET-1161 is fixed now and stale files are not cleaned up on 
> container restarts where the container was not shut down gracefully.
> Especially on high-volume sites lots of files could be left behind and as 
> wicket creates the files it should also clean them up again. I could imagine 
> some kind of (optional) low-priority cleanup background thread that removes 
> files having a lastModifiedTime > threshold value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to