Return-Path: X-Original-To: apmail-aurora-reviews-archive@minotaur.apache.org Delivered-To: apmail-aurora-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7931B17E39 for ; Wed, 22 Apr 2015 22:47:57 +0000 (UTC) Received: (qmail 22824 invoked by uid 500); 22 Apr 2015 22:47:57 -0000 Delivered-To: apmail-aurora-reviews-archive@aurora.apache.org Received: (qmail 22774 invoked by uid 500); 22 Apr 2015 22:47:57 -0000 Mailing-List: contact reviews-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.apache.org Delivered-To: mailing list reviews@aurora.apache.org Received: (qmail 22755 invoked by uid 99); 22 Apr 2015 22:47:57 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2015 22:47:57 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 6EAED1DB62A; Wed, 22 Apr 2015 22:47:58 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5587917015369447297==" MIME-Version: 1.0 Subject: Review Request 33455: Use "a" mode instead of "w" when opening stdout and stderr. From: "Kevin Sweeney" To: "Brian Wickman" Cc: "Kevin Sweeney" , "Aurora" Date: Wed, 22 Apr 2015 22:47:58 -0000 Message-ID: <20150422224758.2948.87982@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Kevin Sweeney" X-ReviewGroup: Aurora X-ReviewRequest-URL: https://reviews.apache.org/r/33455/ X-Sender: "Kevin Sweeney" Reply-To: "Kevin Sweeney" X-ReviewRequest-Repository: aurora --===============5587917015369447297== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33455/ ----------------------------------------------------------- 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 --===============5587917015369447297==--