----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33455/#review83244 -----------------------------------------------------------
ping, Brian - Kevin Sweeney On April 22, 2015, 3:47 p.m., Kevin Sweeney wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33455/ > ----------------------------------------------------------- > > (Updated April 22, 2015, 3:47 p.m.) > > > Review request for Aurora and Brian Wickman. > > > Repository: aurora > > > Description > ------- > > Use "a" mode instead of "w" when opening stdout and stderr. > > This allows an external log rotation process to truncate stdout and stderr > without causing the creation of a sparse file. > > > Diffs > ----- > > src/main/python/apache/thermos/core/process.py > 5ce138dab161d880c0bd58b87a6f5a54d4ca2f99 > > Diff: https://reviews.apache.org/r/33455/diff/ > > > Testing > ------- > > With "w" mode testfile is 300 bytes despite being truncated externally. > ``` > % python 3> testfile > Python 2.7.6 (default, Sep 9 2014, 15:04:36) > [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >>> f = os.fdopen(3, 'w') > >>> f.write(100 * 'a') > >>> f.flush() > > % echo -n '' > testfile > > >>> f.write(200 * 'b') > >>> f.flush() > % ls -l testfile > -rw-r--r-- 1 ksweeney staff 300 Apr 22 15:40 testfile > ``` > > With "a" mode testfile is 200 bytes. > ``` > % python 3> testfile > Python 2.7.6 (default, Sep 9 2014, 15:04:36) > [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >>> f = os.fdopen(3, 'a') > >>> f.write(100 * 'a') > >>> f.flush() > > % echo -n '' > testfile > > >>> f.write(200 * 'b') > >>> f.flush() > > % ls -l testfile > -rw-r--r-- 1 ksweeney staff 200 Apr 22 15:40 testfile > ``` > > > Thanks, > > Kevin Sweeney > >