Re: PgAdmin 4 v2.0 stuck in "Initializing the query execution!"

From: Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com>
To: Peterko <coolman(dot)peto(at)centrum(dot)cz>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>, pgadmin-support(at)lists(dot)postgresql(dot)org
Subject: Re: PgAdmin 4 v2.0 stuck in "Initializing the query execution!"
Date: 2017-10-12 09:34:31
Message-ID: CAFiP3vxs1yuzwv9jC=Jq5LdEzUweSPOxvEjr1vTXakuyMVotXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi,

If we closely look at method get (of class CachingSessionManager in
session.py) we can see
that there is check (if sid in self._cache:) before deleting key sid (del
self._cache[sid]).
That mean the key sid was present in _cache when condition was evaluated
but by the time execution
reached to line del self._cache[sid] the key was removed from _cache. The
key was removed by another
thread (we are using flask app with threaded=true).

See method put of same class. If session is updated then it needs to be
updated on disk
also _cache is orderdict so if we remove and add same item back to _cache
then it will be
added to front (this is same as LRU cache).

This LRU behaviour also helps to remove least used sessions from _cache
(memory) and put them on disk
if _cache filled to 80 % of it's full capacity. (see _normalize method of
same class).

I think we should use thread lock
<https://docs.python.org/2/library/threading.html#lock-objects> while
modifying _cache.

--
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Thu, Oct 12, 2017 at 2:31 PM, Peterko <coolman(dot)peto(at)centrum(dot)cz> wrote:

> Hi,
>
> juat give me please instruction how to capture console output into the app
> and I'll do my best to help solve this bug :)
>
>
>
> Peter
>
> ______________________________________________________________
> > Od: Dave Page <dpage(at)pgadmin(dot)org>
> > Komu: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
> > Datum: 12.10.2017 10:40
> > Předmět: Re: PgAdmin 4 v2.0 stuck in "Initializing the query execution!"
> >
>
> > CC: <pgadmin-support(at)lists(dot)postgresql(dot)org>
>
>
> On Thu, Oct 12, 2017 at 6:39 AM, Murtuza Zabuawala <murtuza.zabuawala@
> enterprisedb.com> wrote:
>
>> Yes, Log has no useful information in it.
>> I found same issue reported by another user https://redmine.
>> postgresql.org/issues/2764
>> @Dave,
>> Can we provide 'pgAdmin4.exe' binary with Qt debug support to check if is
>> there any error on Qt side?
>> (Like we have option in browser to check JS related error.)
>>
> That's actually really hard, as the debug build uses a bunch of different
> libraries (and in fact, is arguing with my Python at the moment anyway, and
> failing to startup properly).
> Is there any way we can capture the console output in the app itself?
> Maybe using window.onerror? Seems like that would be a good thing in
> general.
>
>
>>
>> On Thu, Oct 12, 2017 at 4:19 AM, Peterko <coolman(dot)peto(at)centrum(dot)cz> wrote:
>>
>>> Hello,
>>>
>>> please find the attached log.
>>>
>>>
>>>
>>> Unfortunatelly in the log is no message about query exercution.
>>>
>>> There is only message about query cancelation.
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>>
>>>
>>> ______________________________________________________________
>>> > Od: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
>>> > Komu: Peterko <coolman(dot)peto(at)centrum(dot)cz>
>>> > Datum: 11.10.2017 06:33
>>> > Předmět: Re: PgAdmin 4 v2.0 stuck in "Initializing the query
>>> execution!"
>>> >
>>>
>>> > CC: <pgadmin-support(at)lists(dot)postgresql(dot)org>
>>> Hi,
>>> Could you provide pgadmin4 log?
>>>
>>> *Steps:*
>>> 1) Change the logging level to debug, Refer:
>>> https://www.pgadmin.org/faq/#8
>>>
>>> 2) Change the refresh time interval values from '1' to '123456' for all
>>> the graphs to prevent unwanted logging from dashboard queries.
>>> File -> Preferences -> Paths -> Dashboards -> Graphs
>>>
>>> 3) Close pgAdmin4
>>>
>>> 4) Delete/Rename existing pgAdmin4.log file from
>>> C:\Users\<YourUsername>\AppData\Roaming\pgAdmin\
>>>
>>> 5) Open pgAdmin4 again, try to re-produce the issue.
>>>
>>> 6) Send us pgAdmin4.log file so that we can check for any errors.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Wed, Oct 11, 2017 at 4:10 AM, Peterko <coolman(dot)peto(at)centrum(dot)cz>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> I use pgAdmin 4 - version 2.0 on Windows 10 Professional.
>>>>
>>>> I use SSH tunel to connect PostgreSQL server. In PgAdmin I configure
>>>> host as *localhost*.
>>>>
>>>> I successfully connect to the server, I can list all tables, schemas,
>>>> ...
>>>>
>>>> But I cannot run any query, because the query tool stuck in *"Initializing
>>>> the query execution!*"
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Michael Rasmussen 2017-10-12 19:59:29 Re: I'd like a lightweight alternative to pgAdmin4 ?
Previous Message Peterko 2017-10-12 09:01:36 Re: PgAdmin 4 v2.0 stuck in "Initializing the query execution!"