My understanding so far:
- couchdb/desktopcouch server crashes for some unknown reason.
- gwibber-service tries to connect to desktopcouch.
- This probably launches a new instance of couchdb/desktopcouch via DBus, but on a different port.
- httplib2 fails to connect to the couchdb server because the couchdb client still holds the url of the crashed server.
- The new httplib2 raises socket.error instead of AttributeError, so there is no reconnect.
- gwibber is launched, which cause the same problem, but httplib2 raises AttributeError (?).
- The gwibber service tries to reconnect, but it fails for the same reason.
I can improve things with the following (crude) code appended to desktopcouch/records/server.py, but gwibber will still crash by not handling exceptions in other cases :
def get_records(self, record_type=None, create_view=False, design_doc=None):
try:
return super(CouchDatabase, self).get_records(record_type, create_view, design_doc)
except:
print "*** lp522538 ***"
print "old uri: %s" % self.server_uri
# Find the new port on which couchdb is listening.
port = desktopcouch.find_port(ctx=self._server_class_extras["ctx"]) self.server_uri = "http://localhost:%s" % port
print "new uri: %s" % self.server_uri self._reconnect()
return super(CouchDatabase, self).get_records(record_type, create_view, design_doc)
The content of desktop- couchdb. stderr. * when gwibber-service stops working properly:
heart_beat_kill_pid = 2954
heart_beat_timeout = 11
heart: Thu Jun 24 10:19:32 2010: Erlang has closed.^M
Segmentation fault
heart: Thu Jun 24 10:19:34 2010: Executed "/usr/bin/couchdb -k". Terminating.^M
Traceback from gwibber-service is:
File "/usr/lib/ python2. 6/dist- packages/ gwibber/ microblog/ dispatcher. py", line 540, in refresh collector. get_operations( )) pymodules/ python2. 6/httplib2/ __init_ _.py", line 750, in connect
operations = list(self.
[...]
File "/usr/lib/
raise socket.error, msg
socket.error: [Errno 111] Connexion refusée
If I relaunch gwibber, I get the following log message from gwibber-service. This comes from the patch of bug #539674 :
WARNING:root:DB connection timed out. Reconnecting.
My understanding so far: desktopcouch server crashes for some unknown reason. desktopcouch via DBus, but on a different port.
- couchdb/
- gwibber-service tries to connect to desktopcouch.
- This probably launches a new instance of couchdb/
- httplib2 fails to connect to the couchdb server because the couchdb client still holds the url of the crashed server.
- The new httplib2 raises socket.error instead of AttributeError, so there is no reconnect.
- gwibber is launched, which cause the same problem, but httplib2 raises AttributeError (?).
- The gwibber service tries to reconnect, but it fails for the same reason.
I can improve things with the following (crude) code appended to desktopcouch/ records/ server. py, but gwibber will still crash by not handling exceptions in other cases :
def get_records(self, record_type=None, create_view=False,
design_ doc=None) : base, self).get_ records( record_ type, create_view, design_doc) find_port( ctx=self. _server_ class_extras[ "ctx"])
self. server_ uri = "http:// localhost:%s" % port
self. _reconnect( ) base, self).get_ records( record_ type, create_view, design_doc)
try:
return super(CouchData
except:
print "*** lp522538 ***"
print "old uri: %s" % self.server_uri
# Find the new port on which couchdb is listening.
port = desktopcouch.
print "new uri: %s" % self.server_uri
return super(CouchData