Starting CherryPy in a Thread Locks when the Engine Restarted

Anonymous avatarAnonymous created an issue

Starting CherryPy in a thread causes a lockup when the engine restarts. The process is created as follows (interface/web.py)

import cherrypy
import threading

class listener( threading.Thread ):

	def __init__( self, port, parent_object ):
		threading.Thread.__init__( self )
		self.daddy = parent_object
		self.cpy = None		

	def run( self ):
		self.cpy = cherrypy.quickstart( self )

	def stop( self ):
		self.cpy.stop()

and created as

web_interface = interface.web.listener( 8080, self )

When web.py is updated, it hangs waiting for the main thread

[01/Nov/2011:14:00:34] ENGINE Restarting because /Users/tyndyll/Desktop/spEos/src/interface/web.py changed.
INFO:cherrypy.error:[01/Nov/2011:14:00:34] ENGINE Restarting because /Users/tyndyll/Desktop/spEos/src/interface/web.py changed.
[01/Nov/2011:14:00:34] ENGINE Stopped thread 'Autoreloader'.
INFO:cherrypy.error:[01/Nov/2011:14:00:34] ENGINE Stopped thread 'Autoreloader'.
[01/Nov/2011:14:00:34] ENGINE Bus STOPPING
INFO:cherrypy.error:[01/Nov/2011:14:00:34] ENGINE Bus STOPPING
[01/Nov/2011:14:00:37] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) shut down
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) shut down
[01/Nov/2011:14:00:37] ENGINE Stopped thread '_TimeoutMonitor'.
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Stopped thread '_TimeoutMonitor'.
[01/Nov/2011:14:00:37] ENGINE Bus STOPPED
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Bus STOPPED
[01/Nov/2011:14:00:37] ENGINE Bus EXITING
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Bus EXITING
[01/Nov/2011:14:00:37] ENGINE Bus EXITED
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Bus EXITED
[01/Nov/2011:14:00:37] ENGINE Waiting for child threads to terminate...
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Waiting for child threads to terminate...
[01/Nov/2011:14:00:37] ENGINE Waiting for thread MainThread.
INFO:cherrypy.error:[01/Nov/2011:14:00:37] ENGINE Waiting for thread MainThread.

It remains in this state until it is stopped via Ctrl+C

Comments (1)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.