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.p...@centrum.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 <dp...@pgadmin.org> > > Komu: Murtuza Zabuawala <murtuza.zabuaw...@enterprisedb.com> > > Datum: 12.10.2017 10:40 > > Předmět: Re: PgAdmin 4 v2.0 stuck in "Initializing the query execution!" > > > > > CC: <pgadmin-support@lists.postgresql.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.p...@centrum.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.zabuaw...@enterprisedb.com> >>> > Komu: Peterko <coolman.p...@centrum.cz> >>> > Datum: 11.10.2017 06:33 >>> > Předmět: Re: PgAdmin 4 v2.0 stuck in "Initializing the query >>> execution!" >>> > >>> >>> > CC: <pgadmin-support@lists.postgresql.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.p...@centrum.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 >