#1516 assigned defect

don't catch and ignore EnvironmentError when trying to get disk stats

Reported by: zooko Owned by: davidsarah
Priority: minor Milestone: soon
Component: code-storage Version: 1.9.0a1
Keywords: error Cc:
Launchpad Bug:

Description

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.

Change History (3)

comment:1 Changed at 2011-08-30T11:16:29Z by davidsarah

  • Milestone changed from undecided to 1.10.0
  • Owner set to davidsarah
  • Status changed from new to assigned

comment:2 Changed at 2012-04-01T04:00:15Z by davidsarah

  • Milestone changed from 1.11.0 to 1.10.0

comment:3 Changed at 2012-12-13T17:23:20Z by davidsarah

  • Milestone changed from 1.10.0 to 1.11.0
Note: See TracTickets for help on using tickets.