#4164 closed defect (duplicate)
SVN authz_ spins on RepositoryManager lock
| Reported by: | 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 (last modified by )
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.
Attachments (0)
Change History (6)
follow-up: 2 comment:1 by , 19 years ago
comment:2 by , 19 years ago
Quoted configs:
track.ini:
[trac] authz_module_name = resolver authz_file = /etc/apache2/svnpolicy
svnpolicy:
[/] * = r jkyllo = rw [resolver:/] jkyllo = rw [movgen:/] jkyllo = rw
comment:3 by , 19 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 19 years ago
| Version: | 0.10 → 0.10.2 |
|---|
comment:6 by , 19 years ago
| Version: | 0.10.2 → 0.10.1 |
|---|
Well, yes, you were 30 seconds faster than me ;)
Thanks for the report, but you're wrong, you must be using 0.10.1, as this very issue (duplicate of #3996) is one of the few which has been fixed for the bugfix release 0.10.2.
Check by yourself:
- source:tags/trac-0.10.1/trac/versioncontrol/svn_authz.py@#L35
- source:tags/trac-0.10.2/trac/versioncontrol/svn_authz.py@#L35
(also, the line in question is 40, not 48, so that file must have been modified as well)



Forgot to code quote the traceback and the diff:
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!diff:
63a64 > self.called = False 67a69,72 > if self.called: > raise Exception('get_repository already called!') > self.called = True >