Commit 3140cc3f authored by Jim Fulton's avatar Jim Fulton

Debugged exit-status code propigation.

parent ee87740d
...@@ -112,10 +112,7 @@ from Producers import ShutdownProducer, LoggingProducer ...@@ -112,10 +112,7 @@ from Producers import ShutdownProducer, LoggingProducer
from cStringIO import StringIO from cStringIO import StringIO
from tempfile import TemporaryFile from tempfile import TemporaryFile
import socket import socket, string, os, sys, time
import string
import os
import time
tz_for_log=compute_timezone_for_log() tz_for_log=compute_timezone_for_log()
...@@ -376,16 +373,20 @@ class PCGIPipe: ...@@ -376,16 +373,20 @@ class PCGIPipe:
self._channel.push('%010d%s%010d' % (l, data, 0), 0) self._channel.push('%010d%s%010d' % (l, data, 0), 0)
self._channel.push(LoggingProducer(self._channel, l, 'log_request'), 0) self._channel.push(LoggingProducer(self._channel, l, 'log_request'), 0)
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
self._channel.push(ShutdownProducer(), 0) self._channel.push(ShutdownProducer(), 0)
Wakeup(lambda: asyncore.close_all())
else: else:
self._channel.push(None, 0) self._channel.push(None, 0)
Wakeup() Wakeup()
self._channel=None self._channel=None
def finish(self,request): def finish(self,request):
if request.headers.get('bobo-exception-type','') == \ if request.headers.get('bobo-exception-type','') == \
'exceptions.SystemExit': 'exceptions.SystemExit':
r=response.headers.get('bobo-exception-value','0') r=request.headers.get('bobo-exception-value','0')
try: r=string.atoi(r) try: r=string.atoi(r)
except: r = r and 1 or 0 except: r = r and 1 or 0
self._shutdown=r, self._shutdown=r,
...@@ -112,10 +112,7 @@ from Producers import ShutdownProducer, LoggingProducer ...@@ -112,10 +112,7 @@ from Producers import ShutdownProducer, LoggingProducer
from cStringIO import StringIO from cStringIO import StringIO
from tempfile import TemporaryFile from tempfile import TemporaryFile
import socket import socket, string, os, sys, time
import string
import os
import time
tz_for_log=compute_timezone_for_log() tz_for_log=compute_timezone_for_log()
...@@ -376,16 +373,20 @@ class PCGIPipe: ...@@ -376,16 +373,20 @@ class PCGIPipe:
self._channel.push('%010d%s%010d' % (l, data, 0), 0) self._channel.push('%010d%s%010d' % (l, data, 0), 0)
self._channel.push(LoggingProducer(self._channel, l, 'log_request'), 0) self._channel.push(LoggingProducer(self._channel, l, 'log_request'), 0)
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
self._channel.push(ShutdownProducer(), 0) self._channel.push(ShutdownProducer(), 0)
Wakeup(lambda: asyncore.close_all())
else: else:
self._channel.push(None, 0) self._channel.push(None, 0)
Wakeup() Wakeup()
self._channel=None self._channel=None
def finish(self,request): def finish(self,request):
if request.headers.get('bobo-exception-type','') == \ if request.headers.get('bobo-exception-type','') == \
'exceptions.SystemExit': 'exceptions.SystemExit':
r=response.headers.get('bobo-exception-value','0') r=request.headers.get('bobo-exception-value','0')
try: r=string.atoi(r) try: r=string.atoi(r)
except: r = r and 1 or 0 except: r = r and 1 or 0
self._shutdown=r, self._shutdown=r,
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