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 1f0nem-0004nW-PX for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 12:24:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0nel-0006VS-2c for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 12:24:51 +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 1f0neX-0004wB-Ht for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 12:24:37 +0000 Received: from smtp.twyn.com ([194.112.241.8]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0neS-0004qh-TY for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 12:24:36 +0000 Received: from localhost (unknown [127.0.0.1]) by smtp.twyn.com (Postfix) with ESMTP id 5143D120A92; Tue, 27 Mar 2018 12:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=twyn.com; h= x-mailer:content-type:content-type:mime-version:subject:subject :references:in-reply-to:message-id:from:from:date:date:received :received:received:received:received; s=mail; t=1522153467; x= 1523967868; bh=kJ/NI1kW5a9Q22Yt7H3+1N7iG6NddicuXvaUTBQwz9s=; b=h wPNJZqjgjbitREy9a2muoD8AGgvC+2UJ71lq6dBQ6XaWd45l8pM6ywHXFY0lO7rk 1s+meb1KYROECPR8BxCoC6PXNHSLXrHjvuVZXgvYYhfo0lbnCl9TrX63KlTLXBFZ Hr9KSTQLVNQ9JKQ3hSeAV6yVVtNx5bUtUoEC+BabnA= X-Virus-Scanned: amavisd-new at twyn.com Received: from smtp.twyn.com ([127.0.0.1]) by localhost (smtp.twyn.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4a34a3_6uv7w; Tue, 27 Mar 2018 14:24:27 +0200 (CEST) Received: from at460ex01.connexgroup.net (at460ex01.connexgroup.net [192.168.2.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.twyn.com (Postfix) with ESMTPS id 673111200BF; Tue, 27 Mar 2018 14:24:27 +0200 (CEST) Received: from at460ex01.connexgroup.net (localhost [127.0.0.1]) by at460ex01.connexgroup.net (Postfix) with ESMTPS id 2044D16E6176; Tue, 27 Mar 2018 14:24:27 +0200 (CEST) Received: from at460ex01.connexgroup.net (localhost [127.0.0.1]) by at460ex01.connexgroup.net (Postfix) with ESMTPS id EE0D416E629E; Tue, 27 Mar 2018 14:24:26 +0200 (CEST) Received: from at460ex01.connexgroup.net (AT460EX01.connexgroup.net [192.168.2.35]) by at460ex01.connexgroup.net (Postfix) with ESMTP id D5C2F16E6176; Tue, 27 Mar 2018 14:24:26 +0200 (CEST) Date: Tue, 27 Mar 2018 14:24:26 +0200 (CEST) From: Wilhelm Wurzer To: pgadmin-hackers Cc: Murtuza Zabuawala Message-ID: <624110606.2586732.1522153466523.JavaMail.zimbra@connexgroup.net> In-Reply-To: References: <96167950.2563944.1522151063432.JavaMail.zimbra@connexgroup.net> Subject: Re: pgadmin healthcheck-url MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2586731_1320723833.1522153466521" X-Originating-IP: [192.168.2.205] X-Mailer: Zimbra 8.6.0_GA_1162 (ZimbraWebClient - GC65 (Linux)/8.6.0_GA_1162) Thread-Topic: pgadmin healthcheck-url Thread-Index: /xvKOZJHXFoHd1a9GbAh4UeqIVg2rw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2586731_1320723833.1522153466521 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi,=20 thanks, but a cookie / session-file is still created:=20 Request URL: http://xxx.com/misc/ping=20 Request Method: GET=20 Status Code: 200 OK=20 Response:=20 Date: Tue, 27 Mar 2018 12:17:55 GMT=20 Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5= =20 Set-Cookie: pga4_session=3D"23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eI= y5kQqoGUU+QD8+VRo=3D"; Expires=3DWed, 28-Mar-2018 12:17:55 GMT; HttpOnly; P= ath=3D/=20 FileSystem:=20 4 -rw-r--r-- 1 48 48 162 27. M=C3=A4r 12:17 23068f07-c448-4054-9654-95a9cf1= f700f=20 best regards,=20 Wilhelm Wurzer=20 Von: "Murtuza Zabuawala" =20 An: "Wilhelm Wurzer" =20 CC: "pgadmin-hackers" =20 Gesendet: Dienstag, 27. M=C3=A4rz 2018 13:51:56=20 Betreff: Re: pgadmin healthcheck-url=20 You can use ' /misc/ping ' route to check if pgAdmin4 is running.=20 Example: http://localhost:5050/misc/ping=20 On Success you will get,=20 Status code: 200=20 Response text: PING=20 --=20 Regards,=20 Murtuza Zabuawala=20 EnterpriseDB: http://www.enterprisedb.com=20 The Enterprise PostgreSQL Company=20 On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer < wilhelm.wurzer@twyn.com >= wrote:=20 Hi,=20 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.=20 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..)=20 I looked at the sourcecode and found that in session.py, line 259 it looks = like cookies should not be created for static resources=20 -=20 def open_session(self, app, request):=20 cookie_val =3D request.cookies.get(app.session_cookie_name)=20 if not cookie_val or '!' not in cookie_val:=20 # Don't bother creating a cookie for static resources=20 for sp in self.skip_paths:=20 if request.path.startswith(sp):=20 return None=20 -=20 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'm = no python hacker, so maybe i'm missing something)=20 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 ?=20 thanks a lot,=20 Wilhelm Wurzer=20 twyn group GmbH=20 ------=_Part_2586731_1320723833.1522153466521 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,

thanks, but a co= okie / session-file is still created:

Request URL:= http://xxx.com/misc/ping
Request Method: GET
Status Code: 200 OK
=

Response:
Date: Tue, 27 M= ar 2018 12:17:55 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips m= od_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-20= 18 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-95a9cf1f700f

best regards,
Wilhelm Wurzer


Von: "Murtuza Zabuawala" &l= t;murtuza.zabuawala@enterprisedb.com>
An: "Wilhelm Wurzer" <= ;wilhelm.wurzer@twyn.com>
CC: "pgadmin-hackers" <pgadmin-ha= ckers@lists.postgresql.org>
Gesendet: Dienstag, 27. M=C3=A4rz = 2018 13:51:56
Betreff: Re: pgadmin healthcheck-url
=
Yo= u can use '/misc/ping' route to check if pgAdmin4 is running.


On Success you wi= ll get,
Status code: 200
Response text: PING


=
=
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterp= risedb.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'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



------=_Part_2586731_1320723833.1522153466521--