Edgewall Software

Ticket #4164 (closed defect: duplicate)

Opened 23 months ago

Last modified 23 months ago

SVN authz_ spins on RepositoryManager lock

Reported by: jkyllo-trac@… Owned by: cboos
Priority: normal Milestone:
Component: version control/browser Version: 0.10.1
Severity: normal Keywords:
Cc:

Description (last modified by eblot) (diff)

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

Change History

follow-up: ↓ 2   Changed 23 months ago by anonymous

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
>

in reply to: ↑ 1   Changed 23 months ago by anonymous

Quoted configs:

track.ini:

[trac]
authz_module_name = resolver
authz_file = /etc/apache2/svnpolicy

svnpolicy:

[/]
* = r
jkyllo = rw

[resolver:/]
jkyllo = rw

[movgen:/]
jkyllo = rw

  Changed 23 months ago by eblot

  • description modified (diff)

  Changed 23 months ago by eblot

  • version changed from 0.10 to 0.10.2

  Changed 23 months ago by Jeff Kyllo <jkyllo-trac@…>

  • status changed from new to closed
  • resolution set to duplicate

Duplicate of #3996

  Changed 23 months ago by cboos

  • version changed from 0.10.2 to 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:

(also, the line in question is 40, not 48, so that file must have been modified as well)

Add/Change #4164 (SVN authz_ spins on RepositoryManager lock)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.