Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0pmZ-00065j-8N for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 14:41:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0pmX-00069m-9m for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 14:41:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0pmW-00069d-Ke for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 14:41:01 +0000 Received: from mail-ot0-x235.google.com ([2607:f8b0:4003:c0f::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f0pmS-00081o-TC for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 14:40:59 +0000 Received: by mail-ot0-x235.google.com with SMTP id v23-v6so24740053oth.9 for ; Tue, 27 Mar 2018 07:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=un462mM08aSS6pzGnQaFH1hILG/OPxjEcMjQpwnwCAM=; b=mco9fDwKoSVMWeE7fnfnBXhQquYhU3qnvFN51h1eJa2kTGY/IVpyfijRzommIK0N3l oux3hvj8plib8Q0BD3rfLmH+407Qs149lQ+EFNkJpqmjA9ZjGxZ4DWOfPUY6X6z1L3cc Sj4jBBwbLWQLzsHXDQgFBJlOSs6otZRDcRKNoMkVsun/EY/8TA7xp7fJMp2osItfk2SK CIr9oqOpW2z3YK33B0jnLK/+Zs2YCw6aRrEU8zoBV52ihpp8fCgv7GtKiOknFOL9y4Qj SYMq1VR1XMh+LX376x17K1sy4s8L0g6ueuJmBxcG46f/wMBpU53bZPi+5dMC6Ilg65Ao Dfkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=un462mM08aSS6pzGnQaFH1hILG/OPxjEcMjQpwnwCAM=; b=EGQEZikPNLfy9o+M0XumqgcayiCudm8hNCosZKzND1iJZZ2B0O0Xujtk3HMKhq80bL EmGy5u/LqoydUBSBzZ+0RZMaS7oym8hQ52qfH5b+urqLYGx0D5DehQmu5dZHZwjpdOSY ym8tG74OCOdaTBjgd7vKbh0NlfQItvbcby57T5WA/eqQqChBiEnO//CBSpQjqKmaxbr1 dAc+yLmFbJFIMF65jjyHFB+Ix7ljXAtv8K2NbGztCw0FwVIfU1zaR64BV4JJBLwevFeK /M7yiQ1sgHY29myRQkuDIWigcoBW4vmg53zFdDrK7E3vK+nqMS3EusmWkzckNb0jvVoC NoOA== X-Gm-Message-State: AElRT7Eaye1lX6XR+07xvijS7UXH7guWoqjw+nwuTxir21P7FF5dvLTj /z8yceSIh/bcElzZsshknryPXKbxumT83X3qPN8S0w== X-Google-Smtp-Source: AG47ELs9VfhnQFISVoBuAemLOMuya1mExC/FnMO3Ks+YeuCSL0BHFzOtz0J5hdeX6RonEm51SGGUozEM6W/FANthIto= X-Received: by 2002:a9d:4e16:: with SMTP id p22-v6mr29599123otf.311.1522161655556; Tue, 27 Mar 2018 07:40:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.6.138 with HTTP; Tue, 27 Mar 2018 07:40:35 -0700 (PDT) In-Reply-To: <954747366.2588213.1522154105646.JavaMail.zimbra@connexgroup.net> References: <96167950.2563944.1522151063432.JavaMail.zimbra@connexgroup.net> <624110606.2586732.1522153466523.JavaMail.zimbra@connexgroup.net> <954747366.2588213.1522154105646.JavaMail.zimbra@connexgroup.net> From: Murtuza Zabuawala Date: Tue, 27 Mar 2018 20:10:35 +0530 Message-ID: Subject: Re: pgadmin healthcheck-url To: Wilhelm Wurzer Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000c55004056865e07a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c55004056865e07a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm not able to re-produce the behaviour when using browser. - Could you let us know the exact steps to re-produce the issue? - How did you trigger http request to hit '/ping' url? -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Tue, Mar 27, 2018 at 6:05 PM, Wilhelm Wurzer wrote: > From the about dialog: > > Version 2.1 > Python Version 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 > (Red Hat 4.8.5-16)] > Flask Version 0.11.1 > > Wilhelm Wurzer > > ------------------------------ > *Von: *"Murtuza Zabuawala" > *An: *"Wilhelm Wurzer" > *CC: *"pgadmin-hackers" > *Gesendet: *Dienstag, 27. M=C3=A4rz 2018 14:30:27 > *Betreff: *Re: pgadmin healthcheck-url > > What is the pgAdmin4 version? > > > On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wurzer > wrote: > >> Hi, >> >> thanks, but a cookie / session-file is still created: >> >> Request URL: http://xxx.com/misc/ping >> Request Method: GET >> Status Code: 200 OK >> >> Response: >> Date: Tue, 27 Mar 2018 12:17:55 GMT >> Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 >> Python/2.7.5 >> Set-Cookie: pga4_session=3D"23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU= /eIy5kQqoGUU+QD8+VRo=3D"; >> Expires=3DWed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=3D/ >> >> FileSystem: >> >> 4 -rw-r--r-- 1 48 48 162 27. M=C3=A4r 12:17 23068f07-c448-4054-9654-95a9= cf >> 1f700f >> >> best regards, >> Wilhelm Wurzer >> >> ------------------------------ >> *Von: *"Murtuza Zabuawala" >> *An: *"Wilhelm Wurzer" >> *CC: *"pgadmin-hackers" >> *Gesendet: *Dienstag, 27. M=C3=A4rz 2018 13:51:56 >> *Betreff: *Re: pgadmin healthcheck-url >> >> You can use '/misc/ping' route to check if pgAdmin4 is running. >> >> Example: http://localhost:5050/misc/ping >> >> On Success you will get, >> Status code: 200 >> Response text: PING >> >> >> -- >> Regards, >> Murtuza Zabuawala >> EnterpriseDB: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> >> >> On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer >> wrote: >> >>> Hi, >>> >>> we are using pgadmin in a docker container on aws. To ensure that the >>> container is up and running, a healthcheck is periodically checking via >>> http, restarting the container if neccessary. >>> >>> When checking the filesystem, we found that for each request, a session >>> file is created. Healthcheck is done twice every 30secs, so we have abo= ut >>> 5600 session files a day. (about 100k after a few days..) >>> >>> >>> I looked at the sourcecode and found that in session.py, line 259 it >>> looks like cookies should not be created for static resources >>> >>> - >>> >>> def open_session(self, app, request): >>> cookie_val =3D request.cookies.get(app.session_cookie_name) >>> >>> if not cookie_val or '!' not in cookie_val: >>> # Don't bother creating a cookie for static resources >>> for sp in self.skip_paths: >>> if request.path.startswith(sp): >>> return None >>> >>> - >>> >>> unfortunately, in __init__.py, when setting up the session interface, >>> skip_paths is empty and so a cookie gets created also for static resour= ces >>> (i'm no python hacker, so maybe i'm missing something) >>> >>> >>> So my question is - is there an url that can be used for healthchecking= , >>> that does not create a session file on every check ? >>> >>> >>> thanks a lot, >>> >>> Wilhelm Wurzer >>> twyn group GmbH >>> >>> >> >> > > --000000000000c55004056865e07a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm not able to re-produce the behaviour when= using browser.

- Could you let us know t= he exact steps to re-produce the issue?
- How did you trigger= http request to hit '/ping' url?
<= br clear=3D"all">
= --
Regards,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Tue, Mar 27, 2018 at 6:05 PM, Wilhelm Wur= zer <wilhelm.wurzer@twyn.com> wrote:
From the about dialog:

Version 2.1Python Version 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 = (Red Hat 4.8.5-16)]
Flask Version 0.11.1

Wilhelm Wurzer


Von: "Murtuza Zabuawala" <murtuza.zabuawala= @enterprisedb.com>
An: "Wilhelm Wurzer" <= ;wilhelm.wurze= r@twyn.com>
CC: "pgadmin-hackers" <pgadmin-hac= kers@lists.postgresql.org>
Gesendet: Dienstag, 27. M= =C3=A4rz 2018 14:30:27
Betreff: Re: pgadmin healthcheck-url

What is the pgAdmin4 version?
<= div class=3D"gmail_extra">
<= div dir=3D"ltr">

=

On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wur= zer <wilhelm.wurzer@twyn.com> wrote:





Von: "Murtuza Zabuawala&qu= ot; <murtuza.zabuawala@enterprisedb.com>
An: "Wi= lhelm Wurzer" <wilhelm.wurzer@twyn.com>
CC: "pgadmin-hacker= s" <pgadmin-hackers@lists.postgresql.org>
Gesende= t: Dienstag, 27. M=C3=A4rz 2018 13:51:56
Betreff: Re: pgadmin= healthcheck-url

You can use '/misc/ping' route to check if pgAdmin4 is runn= ing.


On Success you will get,
Status code: 200
Response text: PING


<= div>
--
Regards,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enter<= wbr>prisedb.com
The Enterprise PostgreSQL Company


On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wur= zer <wilhelm.wurzer@twyn.com> wrote:
Hi,

we are using pgadmin in a docker container on aws. To ensure that the conta= iner is up and running, a healthcheck is periodically checking via http, re= starting the container if neccessary.

When checking the filesystem, we found that for each request, a session fil= e is created. Healthcheck is done twice every 30secs, so we have about 5600= session files a day. (about 100k after a few days..)


I looked at the sourcecode and found that in session.py, line 259 it looks = like cookies should not be created for static resources

-

def open_session(self, app, request):
cookie_val =3D request.cookies.get(app.session_cookie_name)

if not cookie_val or '!' not in cookie_val:
# Don't bother creating a cookie for static resources
for sp in self.skip_paths:
if request.path.startswith(sp):
return None

-

unfortunately, in __init__.py, when setting up the session interface, skip_= paths is empty and so a cookie gets created also for static resources (i= 9;m no python hacker, so maybe i'm missing something)


So my question is - is there an url that can be used for healthchecking, th= at does not create a session file on every check ?


thanks a lot,

Wilhelm Wurzer
twyn group GmbH




<= /div>


--000000000000c55004056865e07a--