camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: GenericFileProducer ISSUE - target deletion with eagerdeletefile set to false
Date Sat, 19 Jan 2013 08:11:07 GMT
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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message