Roundup Tracker - Issues

Message6694

Author rouilj
Recipients joseph_myers, rouilj
Date 2019-10-06.00:31:03
Message-id <20191006003102.0AD014C023C@itserver6.cs.umb.edu>
In-reply-to <alpine.DEB.2.21.1910052358030.28559@digraph.polyomino.org.uk>
In message <alpine.DEB.2.21.1910052358030.28559@digraph.polyomino.org.uk>,
Joseph Myers writes:
>On Sat, 5 Oct 2019, John Rouillard wrote:
>
>> Validating all perms in my tracker means that > 2/3 of the validation
>> would be thrown away on every rest/xmlrpc/web page hit. E.G. If the
>> user's role is User, there is no need to validate the Agent,
>> Provisional User, Anonymous, or Admin roles of permissions every
>> single time.
>
>I was supposing Roundup is being used in a form where the schema is loaded 
>once at startup, not once for each page hit.  E.g. in the normal case 
>roundup-server uses roundup.instance.open (which is where the check would 
>go, somewhere after loading the schema) only once for each named tracker,

I am running a tracker using demo.py (basicaly roundup_server) and I
put:

  print("In open")

at the top of roundup/instance.py Tracker::open which I think is the
source of your roundup.instance.open

I get this output:

  then restart demo. If you want to change backend types, you must use "nuke".

  In open
  127.0.0.1 - - [06/Oct/2019 00:19:37] "GET /demo/ HTTP/1.1" 200 -
  127.0.0.1 - - [05/Oct/2019 20:19:38] "GET /favicon.ico HTTP/1.1" 200 -
  In open
  127.0.0.1 - - [06/Oct/2019 00:19:42] "GET /demo/ HTTP/1.1" 200 -
  127.0.0.1 - - [05/Oct/2019 20:19:42] "GET /favicon.ico HTTP/1.1" 200 -
  In open
  127.0.0.1 - - [06/Oct/2019 00:19:48] "GET /demo/issue?status=-1%2C1%2C2%2C4&@startwith=0&@filter=status&@search_text=&@dispname=Show%20All&@sort=-activity&@columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus&@group=priority&@pagesize=50 HTTP/1.1" 200 -
  In open
  127.0.0.1 - - [06/Oct/2019 00:20:02] "GET /demo/issue?@template=item HTTP/1.1" 200 -

it looks to me like open is getting called on every web hit.

I think this is why the schema is compiled in the optimize path of
Tracker::__init__ since instance.open() evaluates the schema everytime
using:

        if self.optimize:
            # execute preloaded schema object
            self._exec(self.schema, env)

(or similar in the non-optimize path). But I may be reading this wrong.

However the comment at the top of open:

        # load the database schema
        # we cannot skip this part even if self.optimize is set
        # because the schema has security settings that must be
        # applied to each database instance

seems to imply I am interpreting this correctly.

Comments?
History
Date User Action Args
2019-10-06 00:31:04rouiljsetrecipients: + rouilj, joseph_myers
2019-10-06 00:31:04rouiljlinkissue2551062 messages
2019-10-06 00:31:03rouiljcreate