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 1f0nkd-0005Kp-AA for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 12:30:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0nkb-0007fa-8X for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 12:30:53 +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 1f0nka-0007fR-Rg for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 12:30:53 +0000 Received: from mail-ot0-x231.google.com ([2607:f8b0:4003:c0f::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f0nkX-000525-FS for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 12:30:51 +0000 Received: by mail-ot0-x231.google.com with SMTP id n40-v6so7379532otd.3 for ; Tue, 27 Mar 2018 05:30:48 -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=Xl6OzZU3tFD+tn54p+dutz2gXVpzbLU+5DtwOrU4RIw=; b=MwNwAcxS3qB2gWickOwavVQhjxqx1+bhrSxHiZcyZ9PD6LF/wwtf/2QNtOliWWBXNU S2sMTpOch2IRVthjfhbNblFNxspJ2Pu5PEQiuQYRraJieY0pl/pwAaQwPAMV6pFOJOD7 FGWs1tG/pnAjET+iinV62NJgL5sqNR4wgCN3pLPh3zHOR1uxf9tnlzTIAnSVOuofs0T4 v47gupzmi9e2r3kfKcPde2Z5/kAwJOs5zzul3YZe+p5PkTaz9Hd+AGcCZLRXjp7jzPyJ q5avzEqxOVJ/g/VyvMwtAto9MKIh6dj0tEiSCzvVXKBqsu++HKLmIAbr3BSVbIM1BKXj my+w== 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=Xl6OzZU3tFD+tn54p+dutz2gXVpzbLU+5DtwOrU4RIw=; b=tzJMHiOWrRfbZxzswqyST1Lrg/r8gLjHng4R2o+uJg9pkqWFLHSe/2Zrd1ipAAw7AS ui4W0/mk2aooRslq6D6OrRr3wGw3299342LHaiwkgVUkBSW1nRAytflf634xeAmxaoAS BlEqc6APMuHrvIR3AtlneCNc/KgI6rTcrK5XExjZj8zlckf4YIXsBkHTSPwpTSEdjhjl tSXXblzaE2o2W83XXwsXbTzBwI/XofbzIFZ3n+ceiZmh9Wv+MoBu/R5Z4Ao4k+EC62yL cPX17idEwBZr+9B2JsK5cNVog1phTpwTCh3hqCLJK0QgKlvc0LbwVOpPTznJJx85fFqd vMMA== X-Gm-Message-State: AElRT7Ec5wvrJvpVxWK9vGecwkt3cVpenv7apjKzwLsrIUhLqTqPWrH1 KeIqQCYcPt7iV8x3Ecnr0SA23qV9WyzxWHuA3WDAUg== X-Google-Smtp-Source: AG47ELuQVlbVJsYLDJk+3Hl3vXybRV0l6DFygc7r98SxS6fCqbK3UuEzgWnIfqcDhWKk6MlQf0KLL2dMDd84KXvpSu0= X-Received: by 2002:a9d:55bb:: with SMTP id m56-v6mr26231544oth.110.1522153847629; Tue, 27 Mar 2018 05:30:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.6.138 with HTTP; Tue, 27 Mar 2018 05:30:27 -0700 (PDT) In-Reply-To: <624110606.2586732.1522153466523.JavaMail.zimbra@connexgroup.net> References: <96167950.2563944.1522151063432.JavaMail.zimbra@connexgroup.net> <624110606.2586732.1522153466523.JavaMail.zimbra@connexgroup.net> From: Murtuza Zabuawala Date: Tue, 27 Mar 2018 18:00:27 +0530 Message-ID: Subject: Re: pgadmin healthcheck-url To: Wilhelm Wurzer Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000061bd680568640fe4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000061bd680568640fe4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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- > 95a9cf1f700f > > 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 abou= t >> 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 resourc= es >> (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 >> >> > > --00000000000061bd680568640fe4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What is the pgAdmin4 version?
=


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

thanks, but a cookie / session-f= ile is still created:

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

Respon= se:
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-95a9cf1f7= 00f

best regards,
Wilhelm Wurzer


Von: &q= uot;Murtuza Zabuawala" <murtuza.zabuawala@enterprisedb.com>= ;
An: "Wilhelm Wurzer" <wilhelm.wurzer@twyn.com>
CC: = "pgadmin-hackers" <pgadmin-hackers@lists.postgresql.or= g>
Gesendet: Dienstag, 27. M=C3=A4rz 2018 13:51:56
B= etreff: Re: pgadmin healthcheck-url

You = can use '/misc/ping' route to chec= k if pgAdmin4 is running.


On Success you will get,
Status code: 200
Response text: PIN= G


=
--=
Reg= ards,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.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>
--00000000000061bd680568640fe4--