[tahoe-lafs-trac-stream] [tahoe-lafs] #1280: deal with fragile, but disposable, bucket state files
tahoe-lafs
trac at tahoe-lafs.org
Sun Jul 14 16:14:44 UTC 2013
#1280: deal with fragile, but disposable, bucket state files
--------------------------------+--------------------------------
Reporter: francois | Owner: daira
Type: defect | Status: new
Priority: normal | Milestone: 1.11.0
Component: code-nodeadmin | Version: 1.8.1
Resolution: | Keywords: pickle reliability
Launchpad Bug: |
--------------------------------+--------------------------------
Comment (by daira):
Short of reading the stdlib source code, I don't know the set of
exceptions that {{{pickle.load}}} can raise. I'd be open to changing it so
that the {{{catch Exception}}} is only around the {{{pickle.load}}} call,
though. Perhaps something like:
{{{
state = {"version": 1,
"last-cycle-finished": None,
"current-cycle": None,
"last-complete-prefix": None,
"last-complete-bucket": None,
}
try:
f = open(self.statefile, "rb")
except EnvironmentError:
pass
else:
try:
state = pickle.load(f)
except Exception:
pass
finally:
f.close()
}}}
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1280#comment:14>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list