You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Arvind <am...@gmail.com> on 2011/07/12 13:58:50 UTC

Re: SMXCOMP-594: persists in 2009.02

Hi All,

After going through the org.apache.servicemix.file.FilePollerEndPoint.java 

I found that inside the processFileNow method "aFile.exists()"  fails at
times, due to which the lock on the file is never gets released. 

I have verified this by adding the logger. 
http://servicemix.396122.n5.nabble.com/file/n4578634/sampleAppLog.log
sampleAppLog.log  contains the snapshot of the logs which highlights the
issue. Traverse the logs for the file "test_20110612200851_5281.txt".

Hence would like to propose the following code changes(*in bold*) in
FilePollerEndPoint.java. Kindly validate the same

 protected void processFileNow(File aFile) {
        try {
            if (logger.isDebugEnabled()) {
                logger.debug("Processing file " + aFile);
            }
            if (aFile.exists()) {
                processFile(aFile);
            } 
	   *//Proposed code change to fix the issue
	   else {
                if (logger.isDebugEnabled()) {
                    logger.debug("File Not found ..Releasing lock" + aFile);
                }
                unlockAsyncFile(aFile);
            }*
        } catch (Exception e) {
            logger.error("Failed to process file: " + aFile + ". Reason: " +
e, e);
            unlockAsyncFile(aFile);
        }
    }



--
View this message in context: http://servicemix.396122.n5.nabble.com/SMXCOMP-594-persists-in-2009-02-tp4483715p4578634.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: SMXCOMP-594: persists in 2009.02

Posted by Arvind <am...@gmail.com>.
Sometimes File.exists() return false. This is a known issue which has been
raised since jdk 1.4 and has not been fixed yet. 
Details can be found at 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003595
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003595 .

--
View this message in context: http://servicemix.396122.n5.nabble.com/SMXCOMP-594-persists-in-2009-02-tp4483715p4583155.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.