Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-12-11 19:36:08 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-12-11 19:36:08 (GMT)
commit510f81d585ddb860196dca12dcd348dfa68b39b3 (patch)
treebfa86e3197c65f6b837c4af38a01cf0e0ea00508
parent1d68b862da27779d881d2b158b9541823c3bdb27 (diff)
#2545: Just log a warning when unmounting a device that has already been removed.
-rw-r--r--src/olpc/datastore/backingstore.py14
-rw-r--r--src/olpc/datastore/xapianindex.py7
2 files changed, 15 insertions, 6 deletions
diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py
index 12dc582..c8e90aa 100644
--- a/src/olpc/datastore/backingstore.py
+++ b/src/olpc/datastore/backingstore.py
@@ -22,6 +22,8 @@ import threading
import errno
import shutil
import urllib
+import traceback
+import sys
import dbus
import xapian
@@ -267,11 +269,13 @@ class FileBackingStore(BackingStore):
if 'uri' not in desc: desc['uri'] = self.uri
if 'title' not in desc: desc['title'] = self.uri
-
- fp = open(fn, 'w')
- pickle.dump(desc, fp)
- fp.close()
-
+ try:
+ fp = open(fn, 'w')
+ pickle.dump(desc, fp)
+ fp.close()
+ except Exception:
+ logging.error('Unable to write descriptor:\n' + \
+ ''.join(traceback.format_exception(*sys.exc_info())))
@staticmethod
def parse(uri):
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index d071eba..a859aa9 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -22,6 +22,7 @@ import time
import thread
import threading
import warnings
+import traceback
import secore
import xapian as _xapian # we need to modify the QueryParser
@@ -165,7 +166,11 @@ class IndexManager(object):
self.deltact += 1
if force or self.deltact > FLUSH_THRESHOLD:
with self._write_lock:
- self.write_index.flush()
+ try:
+ self.write_index.flush()
+ except Exception:
+ logging.error('Index flush failed:\n' + \
+ ''.join(traceback.format_exception(*sys.exc_info())))
#self.read_index.reopen()
self.deltact = 0
else: