Comment 12 for bug 701329

Revision history for this message
John A Meinel (jameinel) wrote :

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

=== modified file 'loggerhead/controllers/__init__.py'
--- loggerhead/controllers/__init__.py 2009-10-17 08:59:33 +0000
+++ loggerhead/controllers/__init__.py 2011-01-31 18:18:36 +0000
@@ -100,6 +100,7 @@
         template = load_template(self.template_path)
         z = time.time()
         w = BufferingWriter(writer, 8192)
+ import pdb; pdb.set_trace()
         template.expand_into(w, **vals)
         w.flush()
         self.log.info(

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.