Re: [Boost-bugs] [Boost C++ Libraries] #11016: Boost file logging misbehaves when file system is full

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11016: Boost file logging misbehaves when file system is full
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-24 10:12:59


#11016: Boost file logging misbehaves when file system is full
-------------------------------+---------------------
  Reporter: michi@… | Owner: andysem
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: log
   Version: Boost 1.55.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+---------------------

Comment (by Michi Henning <michi.henning@…>):

 Replying to [comment:29 andysem]:

> If you only set the max_size limit then yes, the files will keep piling
 up. The proper fix for that is to set min_free_space - I assume you don't
 want the empty files to appear in the first place, do you?

 Exactly :-)

> No, these limits are not related.

 OK, I'll tinker with that tomorrow, thanks!

> > Is it really that hard to check whether a write failed and, if so,
 stat the file and unlink it if empty? It seems like a simple fix, and it
 would get rid of the empty files. We'd have a more robust system that way.
>
> The question is not about hard. It's about consistency. A special
 behavior should be backed by a good reason.

 I strongly agree with that. I'm coming at this from the perspective of a
 first-time user of boost log. So there is this file rotation thing, I can
 specify file name patterns, limit individual log file sizes, directory
 size, and so. All good. Works really well, no problem. Then I do an
 (admittedly extreme) test, trying it with a full file system.

 Now that you've told me about min_free_space, I go "OK, so if I set that,
 it'll to the right thing". But that come as a real surprise to me. It
 effectively means that, if the file system is full, and I haven't set
 min_free_space, I end up with lots of empty log files. In other words, how
 am I supposed to know that not setting min_free_space causes empty log
 files?

 Prior to your patch, the code was leaking lots of inodes. Now it leaks
 many fewer. Thanks again for that fix! But, is there really a difference
 between leaking many inodes as opposed to one? I can't think of what the
 utility of an empty log file would be, seeing that it contains no
 information, and was created only in order to add information to the file
 in the first place. What's wrong with unlinking a file that cannot be
 written to if the file is empty? Alternatively, what's to be gained by
 leaving the file behind?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11016#comment:30>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC