Unhandled exception in asynchat can take the entire Zope system down

Bug #143898 reported by Chui Tey
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

line 420 of asyncore's error handler calls close()
this calls producer's more() method.
sometimes producers can throw exceptions (in my case, reading from UNC path fails with IOError 22 when the system doesn't have sufficient resources), and this is not caught, bringing down the entire system.
The net result is the entire process comes down.

Traceback (most recent call last):
  File "c:\dw304\lib\python\Zope\Startup\run.py", line 52, in ?
    run()
  File "c:\dw304\lib\python\Zope\Startup\run.py", line 21, in run
    start_zope(opts.configroot)
  File "c:\dw304\lib\python\Zope\Startup\__init__.py", line 68, in start_zope
    Lifetime.loop()
  File "c:\dw304\lib\python\Lifetime.py", line 43, in loop
    lifetime_loop()
  File "c:\dw304\lib\python\Lifetime.py", line 70, in lifetime_loop
    asyncore.poll(timeout, map)
  File "c:\dw304\bin\lib\asyncore.py", line 125, in poll
    write(obj)
  File "c:\dw304\bin\lib\asyncore.py", line 81, in write
    obj.handle_error()
  File "c:\dw304\lib\python\ZServer\medusa\http_server.py", line 445, in handle_error
    asynchat.async_chat.handle_error (self)
  File "c:\dw304\bin\lib\asyncore.py", line 420, in handle_error
    self.close()
  File "c:\dw304\lib\python\ZServer\HTTPServer.py", line 350, in close
    p.more() # free up resources held by producer
  File "c:\dw304\lib\python\ZServer\Producers.py", line 107, in more
    return self.iterator.next()
  File "C:\DW304\DW30500\lib\python\DataWrks\Iterators.py", line 71, in next
    data = self._iterator.next() # throws StopIteration
  File "c:\dw304\lib\python\ZPublisher\Iterators.py", line 43, in next
    raise IOError(22, '')
IOError: (22, '')

if we don't want to patch asyncore, then HTTPServer should catch the error.

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

Changes: submitter email, importance (critical => medium)

Changed in zope2:
importance: Medium → Low
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.