Commit a3db0e00 authored by Andreas Jung's avatar Andreas Jung

- Launchpad #373621: catching and logging exceptions that could cause

  leaking of worker threads
parent c8e631e4
...@@ -23,6 +23,9 @@ Restructuring ...@@ -23,6 +23,9 @@ Restructuring
Features Added Features Added
++++++++++++++ ++++++++++++++
- Launchpad #373621: catching and logging exceptions that could cause
leaking of worker threads
- zExceptions.convertExceptionType: new API, breaking out conversion of - zExceptions.convertExceptionType: new API, breaking out conversion of
exception names to exception types from 'upgradeException'. exception names to exception types from 'upgradeException'.
......
...@@ -11,11 +11,17 @@ ...@@ -11,11 +11,17 @@
# #
############################################################################## ##############################################################################
import logging
LOG = logging.getLogger('ZServerPublisher')
class ZServerPublisher: class ZServerPublisher:
def __init__(self, accept): def __init__(self, accept):
from sys import exc_info
from ZPublisher import publish_module from ZPublisher import publish_module
from ZPublisher.WSGIPublisher import publish_module as publish_wsgi from ZPublisher.WSGIPublisher import publish_module as publish_wsgi
while 1: while 1:
try:
name, a, b=accept() name, a, b=accept()
if name == "Zope2": if name == "Zope2":
try: try:
...@@ -36,3 +42,5 @@ class ZServerPublisher: ...@@ -36,3 +42,5 @@ class ZServerPublisher:
# TODO: Support keeping connections open. # TODO: Support keeping connections open.
a['wsgi.output']._close = 1 a['wsgi.output']._close = 1
a['wsgi.output'].close() a['wsgi.output'].close()
except:
LOG.error('exception caught', exc_info=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment