Ticket #65 (closed task: fixed)

Opened 1 year ago

Last modified 1 year ago

Multiple queue shutdowns possible?

Reported by: fs Owned by: fs
Priority: normal Milestone: 2.1
Component: extension-interface Version:
Keywords: Cc:

Description (last modified by amcgregor) (diff)

Alice wrote:

I believe there was some difficulty with TurboGears' method of spawning two copies when running in debug mode, but the queue shutdown could only be run once, raising an un-handled exception during the second shutdown call. I think it's a good idea to apply your patch, but some testing will need to be done in a TurboGears instance.

Patch was committed in r50. I'll try to ensure that I broke something.

Change History

Changed 1 year ago by fs

err... - that should read "try to ensure that I did not broke something. " of course :-)

Changed 1 year ago by amcgregor

I get:

2007-10-24 13:47:01,565 cherrypy.msg INFO ENGINE: <Ctrl-C> hit: shutting down autoreloader
2007-10-24 13:47:01,565 cherrypy.msg INFO HTTP: HTTP Server shut down
2007-10-24 13:47:01,568 cherrypy.msg INFO ENGINE: <Ctrl-C> hit: shutting down autoreloader
2007-10-24 13:47:01,569 cherrypy.msg INFO HTTP: HTTP Server shut down
2007-10-24 13:47:01,576 turbomail.startup INFO Outbound mail queue manager shutting down.
2007-10-24 13:47:01,576 turbomail.pool DEBUG Shutdown requested.
2007-10-24 13:47:01,577 cherrypy.msg INFO ENGINE: CherryPy shut down
2007-10-24 13:47:01,582 turbomail.startup INFO Outbound mail queue manager shutting down.
Traceback (most recent call last):
  File "./start-turbomailtest.py", line 26, in <module>
    start_server(Root())
  File "/Library/Python/2.5/site-packages/TurboGears-1.0.4b1-py2.5.egg/turbogears/startup.py", line 308, in start_server
    cherrypy.server.start()
  File "/Library/Python/2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cpserver.py", line 72, in start
    Engine.start(self)
  File "/Library/Python/2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cpengine.py", line 94, in start
    self.stop()
  File "/Library/Python/2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cpserver.py", line 167, in stop
    Engine.stop(self)
  File "/Library/Python/2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cpengine.py", line 139, in stop
    func()
  File "/Library/Python/2.5/site-packages/TurboGears-1.0.4b1-py2.5.egg/turbogears/startup.py", line 258, in stopTurboGears
    ext.shutdown_extension()
  File "/Users/amcgregor/Public/TurboMail-2.0.5/turbomail/startup.py", line 69, in shutdown_extension
    turbomail._queue.shutdown()
AttributeError: 'NoneType' object has no attribute 'shutdown'

This is in a newly quickstarted project with a minimal SMTP configuration. No mail was sent - just project startup, wait, Ctrl+C, then the above. Python 2.5.1 on Mac OS X 10.5, latest stable TurboGears, running your latest changes to TurboMail-2.0.5 in development mode.

Changed 1 year ago by amcgregor

  • description modified (diff)

I'll also note that this was a problem in Python 2.4.x on earlier versions of Mac OS X 10.4.9, RedHat Enterprise Server, and Gentoo.

Changed 1 year ago by fs

This problem should be fixed in r51. Tested on Fedora 7 (Python 2.5) and CentOS 4.5 (Python 2.3).

Changed 1 year ago by amcgregor

  • status changed from new to closed
  • resolution set to fixed
  • component changed from unassigned to extension-interface

Cheap, but effective. Confirmed fixed on Mac OS X 10.5 (Python 2.5).

Note: See TracTickets for help on using tickets.