[tahoe-lafs-trac-stream] [tahoe-lafs] #1516: don't catch and ignore EnvironmentError when trying to get disk stats

tahoe-lafs trac at tahoe-lafs.org
Mon Aug 29 11:10:58 PDT 2011


#1516: don't catch and ignore EnvironmentError when trying to get disk stats
--------------------------+---------------------------
 Reporter:  zooko         |          Owner:
     Type:  defect        |         Status:  new
 Priority:  minor         |      Milestone:  undecided
Component:  code-storage  |        Version:  1.9.0a1
 Keywords:  error         |  Launchpad Bug:
--------------------------+---------------------------
 I would rather see things fail than report "available space == 0".

 {{{
 HACK zompu:~/playground/tahoe-lafs/what-393-called-trunk$ darcs diff -u
 src/allmydata/util/fileutil.py
 --- old-what-393-called-trunk/src/allmydata/util/fileutil.py    2011-08-29
 12:06:41.597004643 -0600
 +++ new-what-393-called-trunk/src/allmydata/util/fileutil.py    2011-08-29
 12:06:41.612004695 -0600
 @@ -415,6 +415,3 @@
          return get_disk_stats(whichdir, reserved_space)['avail']
      except AttributeError:
          return None
 -    except EnvironmentError:
 -        log.msg("OS call to get disk statistics failed")
 -        return 0
 }}}

 I did encounter a case where this catch-and-return-0 was hiding the
 existence of a bug. It wasn't a bug in trunk, it was a bug in my working
 version, but still.

-- 
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1516>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list