Re: [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in .pgAdmin session and keep piling up

From: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in .pgAdmin session and keep piling up
Date: 2018-10-09 04:08:16
Message-ID: CAFOhELcCBOWVFMoLRdOdRo-BXq940zhENzdYULY=yfF42eXCNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Mon, Oct 8, 2018 at 6:30 PM Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
wrote:

> Hi Hackers
>
> Attached is the patch to fix the RM #3674 "Old session files are not
> cleared in .pgAdmin session and keep piling up". Patch contains following
> changes:
>
> - With current implementation we have override *get_expiration_time*()
> method of flask and return the expiry time as "datetime.datetime.now() +
> 1 day (hard coded)". Also the time used as *now*() instead of *utcnow*()
> which is there in base class method of flask.
> - *Solution*: We should use *session.permanent *flag and set the *permanent_session_lifetime
> *variable of app. I have remove the overridden function and set the
> session.permanent flag to True, and set the permanent_session_lifetime with
> the specified value in config.py. Added new configuration parameter
> "SESSION_EXPIRATION_TIME_IN_DAYS".
> - Added CHECK_SESSION_FILES_INTERVAL configuration parameter in Hour
> with default value is 24. This is an interval to check the session files
> for the cleanup.
>
> Can we have this call inside FileBackedSessionManager class? As we have
already created the SessionInterface, we should accommodate this into that
interface. Also, I would prefer to have the removal check code while
opening the session. So, before creating any new session, all the old files
(with the threshold we have set in config) should be removed.

@ Akshay,
When you have proposed the design, I couldn't think of this, so, I have
raised my concern now.

@ Team,
Your thoughts?

> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2018-10-09 05:17:14 Re: [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in .pgAdmin session and keep piling up
Previous Message Akshay Joshi 2018-10-08 13:00:02 [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in .pgAdmin session and keep piling up