Edgewall Software

Opened 17 years ago

Last modified 17 years ago

#4164 closed defect

SVN authz_ spins on RepositoryManager lock — at Initial Version

Reported by: jkyllo-trac@… Owned by: Christian Boos
Priority: normal Milestone:
Component: version control/browser Version: 0.10.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Note: This is against 0.10.2 but that version is not yet in the version list.

I have been looking into an issue where trying to use the authz_ functionality for svn results in the source browser hanging. The user experience is that the user clicks on "Browse Source" and the browser never loads a page. While adding a ton of print statements to narrow down what was happening I ended up introducing an error which caused an exception. As it turns out this exception showed the source of the problem: versioncontrol/web_ui/browser.py calls RepositoryManager.get_repository which then calls SubversionConnector.get_repository which then creates a new SubversionAuthorizer. The SubversionAuthorizer then calls Environment.get_repository which in turn calls RepositoryManager.get_repository. Since RepositoryManager locks before performing this call (now for the second time) the application is frozen. To get more info, I added a check before locking and produced the following traceback:

Traceback (most recent call last):

File "/usr/local/lib/python2.3/site-packages/trac/web/main.py", line 379, in dispatch_request

dispatcher.dispatch(req)

File "/usr/local/lib/python2.3/site-packages/trac/web/main.py", line 230, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/web_ui/browser.py", line 95, in process_request

repos = self.env.get_repository(req.authname)

File "/usr/local/lib/python2.3/site-packages/trac/env.py", line 195, in get_repository

return RepositoryManager(self).get_repository(authname)

File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/api.py", line 97, in get_repository

repos = self._connector.get_repository(rtype, rdir, authname)

File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/svn_fs.py", line 268, in get_repository

authz = SubversionAuthorizer(self.env, authname)

File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/svn_authz.py", line 48, in SubversionAuthorizer

repos = env.get_repository()

File "/usr/local/lib/python2.3/site-packages/trac/env.py", line 195, in get_repository

return RepositoryManager(self).get_repository(authname)

File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/api.py", line 74, in get_repository

raise Exception('get_repository already called!')

Exception: get_repository already called!

I have these settings in trac.ini: authz_module_name = resolver authz_file = /etc/apache2/svnpolicy

In this scenario, I have the following authz file: /

  • = r

jkyllo = rw

[resolver:/] jkyllo = rw

[movgen:/] jkyllo = rw

Here is the versioncontrol/api.py diff against 0.10.2 to produce the above traceback: 63a64

self.called = False

67a69,72

if self.called:

raise Exception('get_repository already called!')

self.called = True

I'm not sure what the logic is supposed be, but is there some configuration I'm missing, or is this really a bug?

Thanks.

Change History (0)

Note: See TracTickets for help on using tickets.