public inbox for [email protected]
help / color / mirror / Atom feedpgadmin healthcheck-url
7+ messages / 2 participants
[nested] [flat]
* pgadmin healthcheck-url
@ 2018-03-27 11:44 Wilhelm Wurzer <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Wilhelm Wurzer @ 2018-03-27 11:44 UTC (permalink / raw)
To: [email protected]
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 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 = 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, that does not create a session file on every check ?
thanks a lot,
Wilhelm Wurzer
twyn group GmbH
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-27 11:51 Murtuza Zabuawala <[email protected]>
parent: Wilhelm Wurzer <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Murtuza Zabuawala @ 2018-03-27 11:51 UTC (permalink / raw)
To: Wilhelm Wurzer <[email protected]>; +Cc: [email protected]
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 <[email protected]>
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 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 = 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,
> that does not create a session file on every check ?
>
>
> thanks a lot,
>
> Wilhelm Wurzer
> twyn group GmbH
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-27 12:24 Wilhelm Wurzer <[email protected]>
parent: Murtuza Zabuawala <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Wilhelm Wurzer @ 2018-03-27 12:24 UTC (permalink / raw)
To: pgadmin-hackers <[email protected]>; +Cc: Murtuza Zabuawala <[email protected]>
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="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo="; Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/
FileSystem:
4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-95a9cf1f700f
best regards,
Wilhelm Wurzer
Von: "Murtuza Zabuawala" <[email protected]>
An: "Wilhelm Wurzer" <[email protected]>
CC: "pgadmin-hackers" <[email protected]>
Gesendet: Dienstag, 27. März 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 < [email protected] > 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 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 = 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, that does not create a session file on every check ?
thanks a lot,
Wilhelm Wurzer
twyn group GmbH
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-27 12:30 Murtuza Zabuawala <[email protected]>
parent: Wilhelm Wurzer <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Murtuza Zabuawala @ 2018-03-27 12:30 UTC (permalink / raw)
To: Wilhelm Wurzer <[email protected]>; +Cc: pgadmin-hackers <[email protected]>
What is the pgAdmin4 version?
On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wurzer <[email protected]>
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="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
> Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/
>
> FileSystem:
>
> 4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-
> 95a9cf1f700f
>
> best regards,
> Wilhelm Wurzer
>
> ------------------------------
> *Von: *"Murtuza Zabuawala" <[email protected]>
> *An: *"Wilhelm Wurzer" <[email protected]>
> *CC: *"pgadmin-hackers" <[email protected]>
> *Gesendet: *Dienstag, 27. März 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 <[email protected]>
> 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 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 = 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,
>> that does not create a session file on every check ?
>>
>>
>> thanks a lot,
>>
>> Wilhelm Wurzer
>> twyn group GmbH
>>
>>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-27 12:35 Wilhelm Wurzer <[email protected]>
parent: Murtuza Zabuawala <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Wilhelm Wurzer @ 2018-03-27 12:35 UTC (permalink / raw)
To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers <[email protected]>
------=_Part_2588212_615454418.1522154105644
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-27 14:40 Murtuza Zabuawala <[email protected]>
parent: Wilhelm Wurzer <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Murtuza Zabuawala @ 2018-03-27 14:40 UTC (permalink / raw)
To: Wilhelm Wurzer <[email protected]>; +Cc: pgadmin-hackers <[email protected]>
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 <[email protected]>
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" <[email protected]>
> *An: *"Wilhelm Wurzer" <[email protected]>
> *CC: *"pgadmin-hackers" <[email protected]>
> *Gesendet: *Dienstag, 27. März 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 <[email protected]>
> 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="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
>> Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/
>>
>> FileSystem:
>>
>> 4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-95a9cf
>> 1f700f
>>
>> best regards,
>> Wilhelm Wurzer
>>
>> ------------------------------
>> *Von: *"Murtuza Zabuawala" <[email protected]>
>> *An: *"Wilhelm Wurzer" <[email protected]>
>> *CC: *"pgadmin-hackers" <[email protected]>
>> *Gesendet: *Dienstag, 27. März 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 <[email protected]>
>> 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 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 = 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,
>>> that does not create a session file on every check ?
>>>
>>>
>>> thanks a lot,
>>>
>>> Wilhelm Wurzer
>>> twyn group GmbH
>>>
>>>
>>
>>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgadmin healthcheck-url
@ 2018-03-28 04:17 Wilhelm Wurzer <[email protected]>
parent: Murtuza Zabuawala <[email protected]>
0 siblings, 0 replies; 7+ messages in thread
From: Wilhelm Wurzer @ 2018-03-28 04:17 UTC (permalink / raw)
To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers <[email protected]>
------=_Part_2730383_1914417137.1522210660633
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi,=20
i did the test in the browser (chrome), but it can as well be reproduced us=
ing "curl". The logging ('-v') shows that the session cookies is sent with =
the response.=20
[ec2-user@ip-10-0-7-174 ~]$ curl -v http://10.0.7.174:8084/misc/ping=20
* Trying 10.0.7.174...=20
* TCP_NODELAY set=20
* Connected to 10.0.7.174 (10.0.7.174) port 8084 (#0)=20
> GET /misc/ping HTTP/1.1=20
> Host: 10.0.7.174:8084=20
> User-Agent: curl/7.53.1=20
> Accept: */*=20
>=20
< HTTP/1.1 200 OK=20
< Date: Wed, 28 Mar 2018 04:13:14 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"3fe44565-2f57-49f0-8674-df6f710fae07!kHKTBGuk=
+SBKUy+TN2r6XlAyKAI=3D"; Expires=3DThu, 29-Mar-2018 04:13:14 GMT; HttpOnly;=
Path=3D/=20
< Content-Length: 4=20
< Content-Type: text/html; charset=3Dutf-8=20
<=20
* Connection #0 to host 10.0.7.174 left intact=20
PING=20
Wilhelm Wurzer=20
Von: "Murtuza Zabuawala" <[email protected]>=20
An: "Wilhelm Wurzer" <[email protected]>=20
CC: "pgadmin-hackers" <[email protected]>=20
Gesendet: Dienstag, 27. M=C3=A4rz 2018 16:40:35=20
Betreff: Re: pgadmin healthcheck-url=20
I'm not able to re-produce the behaviour when using browser.=20
- Could you let us know the exact steps to re-produce the issue?=20
- How did you trigger http request to hit '/ping' url?=20
--=20
Regards,=20
Murtuza Zabuawala=20
EnterpriseDB: http://www.enterprisedb.com=20
The Enterprise PostgreSQL Company=20
On Tue, Mar 27, 2018 at 6:05 PM, Wilhelm Wurzer < [email protected] >=
wrote:=20
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-03-28 04:17 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 11:44 pgadmin healthcheck-url Wilhelm Wurzer <[email protected]>
2018-03-27 11:51 ` Murtuza Zabuawala <[email protected]>
2018-03-27 12:24 ` Wilhelm Wurzer <[email protected]>
2018-03-27 12:30 ` Murtuza Zabuawala <[email protected]>
2018-03-27 12:35 ` Wilhelm Wurzer <[email protected]>
2018-03-27 14:40 ` Murtuza Zabuawala <[email protected]>
2018-03-28 04:17 ` Wilhelm Wurzer <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox