Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#6826 closed enhancement (fixed)

Excessive calls of filter.pre_process_request for one request

Reported by: jaguar.arx@… Owned by: Remy Blank
Priority: normal Milestone: 0.12-multirepos
Component: version control Version: 0.11b1
Severity: minor Keywords: filters pre_process_request TimelineModule RepositoryManager multirepos
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

I tested work RepositoryManager.sync Found that it is called each time during the RequestDispatcher. And when the request was "js", "css" or "png" file, these filters are still operable. Also called filter of TimelineModule. I believe that this is unnecessary, they should operate only for the modules.

Example. I added an out to log in a line 284 of file trac\web\main.py and made a request to the page. This is what happened in the log.

2008-02-13 21:15:12,713 Trac[main] DEBUG: Dispatching <Request "GET u'/svnstat'">
2008-02-13 21:15:12,743 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:12,743 Trac[api] DEBUG: TEST: pre_process
2008-02-13 21:15:12,822 Trac[svn_fs] DEBUG: Subversion bindings imported
2008-02-13 21:15:12,838 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:12,838 Trac[session] DEBUG: Retrieving session for ID '4b626e0478ae6a5e20b1b01c'
2008-02-13 21:15:12,884 Trac[chrome] DEBUG: Prepare chrome data for request
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
2008-02-13 21:15:13,493 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/css/trac.css'">
2008-02-13 21:15:13,493 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:13,493 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:13,759 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/jquery.js'">
2008-02-13 21:15:13,759 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:13,759 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,588 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/trac.js'">
2008-02-13 21:15:14,588 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,588 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,665 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/search.js'">
2008-02-13 21:15:14,665 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,665 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,806 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/trac_banner.png'">
2008-02-13 21:15:14,806 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,806 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,822 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/trac_logo_mini.png'">
2008-02-13 21:15:14,822 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,822 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,869 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/topbar_gradient.png'">
2008-02-13 21:15:14,869 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,869 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,884 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/dots.gif'">
2008-02-13 21:15:14,884 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,884 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:15,009 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/topbar_gradient2.png'">
2008-02-13 21:15:15,026 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:15,026 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:36:56,960 Trac[main] DEBUG: Dispatching <Request "GET u'/login'">
2008-02-13 21:36:56,960 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:36:56,960 Trac[api] DEBUG: TEST: pre_process
2008-02-13 21:36:57,007 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 16 years ago

Component: generalversion control
Description: modified (diff)
Milestone: 0.11.10.12
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor

The RepositoryManager pre_process_request does guard against the secondary requests (the if handler is not Chrome(self.env): test does that).

The timeline pre_process_request does nothing and its post_process_request does also a check (the if data: test).

So in both cases, there's no real performance impact.

But for the next release, I'd like to change the way the repository synchronization is done (as that's not scalable with the MultipleRepositorySupport) and that IRequestFilter filter will be history.

Setting milestone to 0.12 as a reminder to clean-up the IRequestFilter.

comment:2 by Christian Boos, 15 years ago

Keywords: multirepos added
Milestone: 0.130.12
Resolution: fixed
Status: newclosed

Done in the MultiRepos branch, in r8397.

By setting [trac] repository_sync_per_request to empty, no repository will be synced at the request preprocessing stage.

comment:3 by Christian Boos, 15 years ago

Owner: changed from Christian Boos to Remy Blank

comment:4 by Christian Boos, 15 years ago

Milestone: 0.120.12-multirepos

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.