Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 79682 invoked from network); 22 Mar 2011 12:47:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 12:47:45 -0000 Received: (qmail 96365 invoked by uid 500); 22 Mar 2011 12:47:45 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 96275 invoked by uid 500); 22 Mar 2011 12:47:45 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 96265 invoked by uid 99); 22 Mar 2011 12:47:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 12:47:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 12:47:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B7D9442C3F for ; Tue, 22 Mar 2011 12:47:05 +0000 (UTC) Date: Tue, 22 Mar 2011 12:47:05 +0000 (UTC) From: "Maria Iracheta (JIRA)" To: dev@camel.apache.org Message-ID: <717082660.3647.1300798025749.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1472133264.11661.1300457429499.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAMEL-3789) org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy is not thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maria Iracheta updated CAMEL-3789: ---------------------------------- Attachment: MarkerFileExclusiveReadLockStrategy.java.patch This readLockStrategy was not thread-safe. It was unlocking the last File that had been locked. Now each of the methods recreates the lock file based on the input attributes > org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy is not thread-safe > ----------------------------------------------------------------------------------------------- > > Key: CAMEL-3789 > URL: https://issues.apache.org/jira/browse/CAMEL-3789 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.6.0 > Reporter: Maria Iracheta > Attachments: MarkerFileExclusiveReadLockStrategy.java.patch > > > MarkerFileExclusiveReadLockStrategy is not thread-safe. When I run a File endpoint with more than one thread the MarkerFileExclusiveReadLockStrategy only deletes the last file to start being processed. > The MarkerFileExclusiveReadLockStrategy uses global variables: > private File lock; > private String lockFileName; > and gives them values on the acquireExclusiveReadLock method. When another thread calls the releaseExclusiveReadLock method it uses the global variables to delete the locked file. That means that if another thread came and called the acquireExclusiveReadLock it would have changed the values on the global variables. > If lock and lockFileName are not global variables the problem seems to disappear and I can a multithreaded File endpoint and not locked file is left undeleted. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira