This doesn't seem to be a bug in loggerhead, but rather how it is being called from the Launchpad code. So for now I'm closing the loggerhead side of it.
I determined this by running with this patch:
=== modified file 'loggerhead/apps/branch.py'
--- loggerhead/apps/branch.py 2010-12-01 08:30:02 +0000
+++ loggerhead/apps/branch.py 2011-01-31 18:34:00 +0000
@@ -171,7 +171,11 @@
try:
try:
c = cls(self, self.get_history)
- return c(environ, start_response)
+ try:
+ return c(environ, start_response)
+ except socket.error, e:
+ self.log.warning('Caught a failure.... baby')
+ raise except: environ['exc_info'] = sys.exc_info() environ['branch'] = self
Basically, adding an exception grab as part of the branch app, and a pdb giving me plenty of time to sync with closing the browser.
After doing so, the output on the console was:
> c:\users\jameinel\dev\bzr\plugins\loggerhead\loggerhead\controllers\__init__.py(104)__call__()
-> template.expand_into(w, **vals)
(Pdb) c
Caught a failure.... baby
In other words, no traceback, etc. So whatever the normal mechanism is in loggerhead, it cleanly suppresses the EPIPE error. It could just be the EPIPE handling from 'bzr serve' or whatever. But it seems to make the most sense that it should be the Launchpad codebase that suppresses the error, and not done locally in the Branch.app code.
This doesn't seem to be a bug in loggerhead, but rather how it is being called from the Launchpad code. So for now I'm closing the loggerhead side of it.
I determined this by running with this patch: apps/branch. py' apps/branch. py 2010-12-01 08:30:02 +0000 apps/branch. py 2011-01-31 18:34:00 +0000 warning( 'Caught a failure.... baby')
except:
environ[ 'exc_info' ] = sys.exc_info()
environ[ 'branch' ] = self
=== modified file 'loggerhead/
--- loggerhead/
+++ loggerhead/
@@ -171,7 +171,11 @@
try:
try:
c = cls(self, self.get_history)
- return c(environ, start_response)
+ try:
+ return c(environ, start_response)
+ except socket.error, e:
+ self.log.
+ raise
=== modified file 'loggerhead/ controllers/ __init_ _.py' controllers/ __init_ _.py 2009-10-17 08:59:33 +0000 controllers/ __init_ _.py 2011-01-31 18:18:36 +0000 self.template_ path) (writer, 8192)
template. expand_ into(w, **vals)
self. log.info(
--- loggerhead/
+++ loggerhead/
@@ -100,6 +100,7 @@
template = load_template(
z = time.time()
w = BufferingWriter
+ import pdb; pdb.set_trace()
w.flush()
Basically, adding an exception grab as part of the branch app, and a pdb giving me plenty of time to sync with closing the browser.
After doing so, the output on the console was:
> c:\users\ jameinel\ dev\bzr\ plugins\ loggerhead\ loggerhead\ controllers\ __init_ _.py(104) __call_ _() expand_ into(w, **vals)
-> template.
(Pdb) c
Caught a failure.... baby
In other words, no traceback, etc. So whatever the normal mechanism is in loggerhead, it cleanly suppresses the EPIPE error. It could just be the EPIPE handling from 'bzr serve' or whatever. But it seems to make the most sense that it should be the Launchpad codebase that suppresses the error, and not done locally in the Branch.app code.