#9984 closed defect (fixed)
trac-admin script hangs when TracDeveloperPlugin is enabled
Reported by: | anonymous | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TracDeveloperPlugin |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: | 0.12 |
Description
Then the TracDeveloperPlugin is enabled, the trac-admin
script does not exit after it is done. This only happens for trac-admin
subcommands that load the plugin, like e.g. trac-admin deploy
.
I guess this is because of the thread started by the plugin.
Attachments (0)
Change History (13)
comment:1 Changed 13 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:2 Changed 12 years ago by
Owner: | changed from Alec Thomas to Olemis Lang |
---|
comment:3 follow-up: 4 Changed 11 years ago by
Owner: | changed from Olemis Lang to anonymous |
---|---|
Status: | new → assigned |
comment:4 Changed 11 years ago by
comment:5 follow-up: 8 Changed 11 years ago by
I can't reproduce this issue running Trac=1.0 . May I close this ticket with resolution=worksforme ?
@rjollos : I typed my user name in author box . So ... maybe this is an issue ?
I'm honestly not keen to login to web sites unless they offer open auth mechanisms e.g. OpenId
comment:7 Changed 10 years ago by
Owner: | changed from anonymous to Olemis Lang |
---|
comment:8 Changed 9 years ago by
Replying to olemis:
I can't reproduce this issue running Trac=1.0.
Reproduced with Trac trunk (trac:r14100) and TracDeveloperPlugin r14629 using trac-admin deploy
. Here is the DEBUG level console output before the hang:
Copying resources from: trac.web.chrome.Chrome /Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/htdocs /Users/rjollos/Documents/Workspace/trac-dev/proj-1.1/htdocs tracdeveloper.main.DeveloperPlugin /Users/rjollos/Documents/Workspace/trac-dev/tracdeveloperplugin/trunk/tracdeveloper/htdocs tracdeveloper.dozer.Dozer /Users/rjollos/Documents/Workspace/trac-dev/tracdeveloperplugin/trunk/tracdeveloper/dozer/htdocs Creating scripts. 14:36:15 Trac[__init__] DEBUG: templates=/Users/rjollos/Documents/Workspace/trac-dev/tracdeveloperplugin/trunk/tracdeveloper/dozer/templates
comment:9 Changed 9 years ago by
Reproduced with Trac 1.0.6. I consider that issue must be reproduced with all versions of Trac.
When constructing Dozer
component in tracdeveloper/dozer/__init__.py
, the component creates a non-daemon thread. As the result, the python interpreter waits termination of the thread.
-
tracdeveloperplugin/trunk/tracdeveloper/dozer/__init__.py
diff --git a/tracdeveloperplugin/trunk/tracdeveloper/dozer/__init__.py b/tracdeveloperplugin/trunk/tracdeveloper/dozer/__init__.py index aa1f247..0d9249c 100644
a b class Dozer(Component): 71 71 self.history = {} 72 72 self.samples = 0 73 73 self.runthread = threading.Thread(target=self.start) 74 self.runthread.setDaemon(True) 74 75 self.runthread.start() 75 76 76 77 # IRequestHandler methods
Another suggestion is removing ITemplateProvider
implementation from the Dozer
component (or moving it to another component).
comment:10 Changed 9 years ago by
Thank you for the suggestion and patch. How does the following look?
-
tracdeveloper/dozer/__init__.py
7 7 from StringIO import StringIO 8 8 from types import FrameType, ModuleType 9 9 10 from pkg_resources import resource_filename11 10 # 12 11 # import Image 13 12 # import ImageDraw … … 14 13 15 14 from trac.core import * 16 15 from trac.web.api import IRequestHandler, HTTPNotFound, HTTPForbidden 17 from trac.web.chrome import ITemplateProvider,add_stylesheet, add_script16 from trac.web.chrome import add_stylesheet, add_script 18 17 19 18 from genshi.core import Markup 20 19 from genshi.builder import tag … … 21 20 22 21 # from paste import fileapp 23 22 # from paste import urlparser 24 # from pkg_resources import resource_filename25 23 # from webob import Request, Response 26 24 # from webob import exc 27 25 … … 65 63 period = 5 66 64 maxhistory = 300 67 65 68 implements(IRequestHandler , ITemplateProvider)66 implements(IRequestHandler) 69 67 70 68 def __init__(self): 71 69 self.history = {} 72 70 self.samples = 0 73 71 self.runthread = threading.Thread(target=self.start) 72 self.runthread.setDaemon(True) 74 73 self.runthread.start() 75 74 76 75 # IRequestHandler methods … … 93 92 add_stylesheet(req, 'dozer/main.css') 94 93 return method(req) 95 94 96 # ITemplateProvider methods97 def get_htdocs_dirs(self):98 yield 'dozer', resource_filename(__name__, 'htdocs')99 100 def get_templates_dirs(self):101 self.log.debug('templates=%s', resource_filename(__name__, 'templates'))102 yield resource_filename(__name__, 'templates')103 104 95 # Internal methods 105 96 def start(self): 106 97 self.running = True -
tracdeveloper/main.py
43 43 44 44 def get_templates_dirs(self): 45 45 from pkg_resources import resource_filename 46 return [resource_filename(__name__, 'templates')] 46 return [resource_filename('tracdeveloper', 'templates'), 47 resource_filename('tracdeveloper.dozer', 'templates')] 47 48 48 49 def get_htdocs_dirs(self): 49 50 from pkg_resources import resource_filename 50 return [('developer', resource_filename(__name__, 'htdocs'))] 51 return [('developer', resource_filename('tracdeveloper', 'htdocs')), 52 ('dozer', resource_filename('tracdeveloper.dozer', 'htdocs'))] 51 53 52 54 # IPreferencePanelProvider methods 53 55 def get_preference_panels(self, req):
comment:13 Changed 9 years ago by
Owner: | changed from Olemis Lang to Jun Omae |
---|
Replying to olemis:
I've noticed this a few times when you've accepted tickets - if you accept a ticket without logging in, it will be assigned to anonymous. Just fyi. See also #7397 and #11455.
I'll see if we can modify the workflow to avoid this scenario.