Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37324E13B for ; Sat, 19 Jan 2013 08:11:56 +0000 (UTC) Received: (qmail 11405 invoked by uid 500); 19 Jan 2013 08:11:55 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 11294 invoked by uid 500); 19 Jan 2013 08:11:55 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 11278 invoked by uid 99); 19 Jan 2013 08:11:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2013 08:11:55 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2013 08:11:48 +0000 Received: by mail-ie0-f172.google.com with SMTP id c13so7490960ieb.31 for ; Sat, 19 Jan 2013 00:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=KmaMw2JOSXUB3c/nJ1xBZrdw4KXJ/rcEXvgemSieOMs=; b=bBbUuNpKVXuDfEwNnu4Uc5cg3MuT024avV+WtmyoFILmXsehlfOedUs8a5uiXTISZA MVWzxDqBnSlnwnLKueRMyxFw8u/hGeKWmceawXxq6UL2P55CaSn61iEkaYPSJcgwrmm6 g3IpjnQrNZ+v3PahhxAtFvBUrJx7Th6rGTe5usFMDn2pORewap12lOXnW2BionoXXbuC sk+eZWONa5hNssSYHfQxig4gu+FNfWsrB8iJdFIPkkSq148RmtvFoCsCO20MqqIYGA39 Sv50Jif7sBgzSOwtp3uqrLmo9JhSamA+6Z9fMLwudGO93VMeNoBsNsPLd1Q999gP5jQ0 872g== X-Received: by 10.50.6.230 with SMTP id e6mr4295531iga.3.1358583087263; Sat, 19 Jan 2013 00:11:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.7.16 with HTTP; Sat, 19 Jan 2013 00:11:07 -0800 (PST) In-Reply-To: <1357914382209-5725390.post@n5.nabble.com> References: <1357914382209-5725390.post@n5.nabble.com> From: Claus Ibsen Date: Sat, 19 Jan 2013 09:11:07 +0100 Message-ID: Subject: Re: GenericFileProducer ISSUE - target deletion with eagerdeletefile set to false To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Jan 11, 2013 at 3:26 PM, Marco Crivellaro wrote: > Hi all, > I just noticed an issue related to deleting the target file when writing > using temporary file names and eagerDeleteTargetFile is set to false. > > the producer first checks if target file exists, it than writes the > temporary file. Once temporary file is written the target file is deleted in > case the test performed before writing tmp file was positive. > > The final file might be deleted while temporary file is written and the > producer would throw an exception in such situation; it is possible for the > target file to be deleted while writing temporary file especially when > writing large files or using FTP component. > > I would suggest to check target file existence (and delete it) before > writing temporary file only when eagerDeleteTargetFile is set to true; > when not eagerly deleting target file I would suggest to check target file > existence (and in case delete it) only after temporary file have been > deployed, right before renaming it. > > > > an improvement would be avoiding the target file deletion by simply renaming > temporary file to target once it has been written (this would save a LIST > which might take a long time using FTP). This should be possible when using > FTP producer. This could be a new fileExists option name > 'OptimisticOvveride' where target file is not deleted in case it exists > already. > > > Looking forward for a feedback from the community. > Please let me know if I should open a JIRA ticket (possibly 2 separate > tickets?). > Its probably easier if your work on a patch, then code + this text is easier to understand what you say. > > Regards, > Marco > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/GenericFileProducer-ISSUE-target-deletion-with-eagerdeletefile-set-to-false-tp5725390.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen