[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Patch] Error: BadStatusLine(line)



Hi,

FYI, here's an exception that was raised on tainaron. Small patch
catching the exception is included below, comments are welcome.

===== Beginn =====

Dec 04 01:38:54 themis mixminiond[10219]: [ERROR] Exception in processing thread; shutting down thread.
Dec 04 01:38:54 themis mixminiond[10219]: [ERROR] Traceback (most recent call last):
    File "/usr/lib/python2.4/site-packages/mixminion/ThreadUtils.py", line 324, in run
    job()
    File "/usr/lib/python2.4/site-packages/mixminion/ScheduleUtils.py", line 126, in _background
    next = self.func()
    File "./server/ServerMain.py", line 756, in updateDirectoryClient
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 848, in update
    self.store.update(force=force,now=now,lock=self._lock)
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 617, in update
    for b in self.bases: b.update(force=force,now=now,lock=lock)
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 403, in update
    self.updateDirectory(forceDownload=force,now=now,lock=lock)
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 419, in updateDirectory
    self.downloadDirectory(url=url,lock=lock)
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 430, in downloadDirectory
    self._downloadDirectoryImpl(url,lock)
    File "/usr/lib/python2.4/site-packages/mixminion/ClientDirectory.py", line 471, in _downloadDirectoryImpl
    infile = urllib2.urlopen(request)
    File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
    File "/usr/lib/python2.4/urllib2.py", line 358, in open
    response = self._open(req, data)
    File "/usr/lib/python2.4/urllib2.py", line 376, in _open
    '_open', req)
    File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
    File "/usr/lib/python2.4/urllib2.py", line 1021, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File "/usr/lib/python2.4/urllib2.py", line 994, in do_open
    r = h.getresponse()
    File "/usr/lib/python2.4/httplib.py", line 866, in getresponse
    response.begin()
    File "/usr/lib/python2.4/httplib.py", line 336, in begin
    version, status, reason = self._read_status()
    File "/usr/lib/python2.4/httplib.py", line 300, in _read_status
    raise BadStatusLine(line)
  BadStatusLine
Dec 04 01:38:54 themis mixminiond[10219]: [FATAL] One of our threads has halted; shutting down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Server shutting down
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Telling cleanup thread to shut down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Telling processing thread to shut down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Telling delivery thread to shut down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Telling database thread to shut down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Delivery thread shutting down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Cleanup thread shutting down.
Dec 04 01:38:54 themis mixminiond[10219]: [INFO] Shutting down database thread
Dec 04 01:38:55 themis mixminiond[10219]: [INFO] Server is shut down

===== Ende =====

===== Beginn =====

Index: ClientDirectory.py
===================================================================
--- ClientDirectory.py  (revision 11)
+++ ClientDirectory.py  (revision 12)
@@ -24,6 +24,8 @@
 import rfc822
 import urllib2

+from httplib import HTTPException
+
 import mixminion.Config
 import mixminion.Crypto
 import mixminion.NetUtils
@@ -481,6 +483,9 @@
                 else:
                     raise DirectoryDownloadError(
                         "Error connecting to directory server: %s"%e)
+            except HTTPException, e:
+                raise DirectoryDownloadError(
+                    "HTTP exception downloading directory: %s"%e)
         finally:
             if self.timeout:
                 mixminion.NetUtils.unsetGlobalTimeout()
Index: server/ServerMain.py
===================================================================
--- server/ServerMain.py        (revision 11)
+++ server/ServerMain.py        (revision 12)
@@ -759,7 +759,7 @@
             # Randomly retrieve the directory within an hour after
             # midnight, to avoid hosing the server.
             nextUpdate += prng.getInt(60)*60
-        except mixminion.ClientDirectory.GotInvalidDirectoryError, e:
+        except mixminion.ClientDirectory.DirectoryDownloadError, e:
             LOG.warn(str(e))
             LOG.warn("    I'll try again in an hour.")
             nextUpdate = min(succeedingMidnight(time.time()+30),

===== Ende =====

Ciao

Tobias
-- 
mbox:admin@tainaron

Attachment: pgpELaG6rKhRH.pgp
Description: PGP signature