ClearFoundation Tracker - ClearOS
View Issue Details
0001358ClearOSapp-base - Base Systempublic2013-10-01 11:372016-06-27 11:40
user2 
bchambers 
highfeatureN/A
closedfixed 
7.1.0 Beta 2 
7.1.0 Beta 27.1.0 Beta 2 
0001358: Avoid writing to the file system if disk is nearly full.
Bad things happen when the hard disk fills up, logs no longer writable, services fail, the system becomes unresponsive, and configuration files become corrupt. Throw an exception if the disk is nearly full.
No tags attached.
related to 0001012closed  Create system warning when disk space is nearly full 
Issue History
2013-10-01 11:37user2New Issue
2013-10-01 11:37user2Issue generated from: 0001012
2013-10-01 11:37user2Relationship addedrelated to 0001012
2013-10-02 18:55user2Statusnew => confirmed
2013-10-07 13:51user2Target Version6.5.0 Beta 2 => 6.5.0 Beta 3
2013-10-17 12:27user2Prioritynormal => high
2013-11-21 19:13user2Target Version6.5.0 Beta 3 =>
2015-06-05 13:35bchambersNote Added: 0001641
2015-06-11 12:04bchambersNote Edited: 0001641bug_revision_view_page.php?bugnote_id=1641#r271
2015-06-15 12:50bchambersAssigned To => bchambers
2015-06-15 12:50bchambersStatusconfirmed => assigned
2015-06-15 12:51bchambersIssue cloned: 0003151
2015-06-15 12:59bchambersProduct Version => 7.1.0 Beta 2
2015-06-15 12:59bchambersFixed in Version => 7.1.0 Beta 2
2015-06-15 12:59bchambersTarget Version => 7.1.0 Beta 2
2016-06-27 11:40user2Statusassigned => resolved
2016-06-27 11:40user2Resolutionopen => fixed
2016-06-27 11:40user2Statusresolved => closed

Notes
(0001641)
bchambers   
2015-06-05 13:35   
(edited on: 2015-06-11 12:04)
I think we should bump the priority of this one...can make a bad situation worse.

Proposal to File.php library:

const MIN_BYTES_AVAIL = 100000000; # Choose a number
...
..
.
/**
     * File constructor.
     *
     * @param string $filename target file
     * @param boolean $superuser superuser access required to read the file
     * @param boolean $temporary create a temporary file
     * @param array $options class options
     */

    public function __construct($filename, $superuser = FALSE, $temporary = FALSE, $options = NULL)
    {
        clearos_profile(__METHOD__, __LINE__);

        $free_volume_space = disk_free_space(dirname($filename));
        if ($free_volume_space !== FALSE && $free_volume_space < self::MIN_BYTES_AVAIL)
            throw new Engine_Exception(lang('base_vol_near_capacity'));
...
..
.

PHP function seems very quick...won't impact Webconfig noticeable.