Bug 876337
Summary: | Please fix FileUtils.move (Code enclosed) | ||||||
---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise SOA Platform 5 | Reporter: | Rick Wagner <rwagner> | ||||
Component: | JBossESB | Assignee: | tcunning | ||||
Status: | ON_QA --- | QA Contact: | |||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 5.3.0 GA | CC: | dboeren, soa-p-jira, tcunning | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: |
FileUtil.renameTo(..) returns true even if it fails to rename the file. As a result, when a file that is locked by another process is picked up by the SOA platform, and the rename fails, an error is logged even though the file is processed successfully on the next attempt (when the lock is gone).
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | Type: | Bug | |||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Rick Wagner
2012-11-13 21:20:11 UTC
Change set:
333,334c333
< this.establishDeployedContentList(this.deploymentDir);
< scan(true, deploymentOperations);
---
> scan(true, deploymentOperations);
Created attachment 644973 [details]
Includes fixes.
Attached file includes fixes.
(In reply to comment #1) > Change set: > > 333,334c333 > < this.establishDeployedContentList(this.deploymentDir); > < scan(true, deploymentOperations); > --- > > scan(true, deploymentOperations); --------------------------------------------------------------------------------- Please disregard comment 1. The real changeset is below. Thanks, Rick ]0;rick@rwagner01:~/Junk/a/b[?1034h[rick@rwagner01 b]$ diff *old* *new* 113,114c113,114 < LOGGER.debug("Unable to perform local rename of file '" + from.getAbsolutePath() + "' to '" + fromLocalRename.getAbsolutePath() + "'. Unable to move file."); < return true; --- > LOGGER.debug("Unable to perform local rename of file '" + from.getAbsolutePath() + "' to '" + fromLocalRename.getAbsolutePath() + "'. Unable to move file."); > return false; 120c120 < return true; --- > return false; 131c131 < return true; --- > return false; 209,213c209,213 < try < { < fos.close(); < } < catch (final IOException ioe) {} // ignore --- > try > { > fos.close(); > } > catch (final IOException ioe) {} // ignore 220c220 < fis.close(); --- > fis.close(); 238c238 < while( (reader.read(chars)) > -1){ --- > while( (reader.read(chars)) > -1) { This BZ originated after fix BZ 829876 (on SOA-P 5.1). The easiest way to test this I think is to write a test that opens a file in append mode (the goal is to have a file lock). Then, while the file is open in append mode, call FileUtils.move() on it. Tom Cunningham <tcunning> updated the status of jira JBESB-3882 to Resolved Tom Cunningham <tcunning> updated the status of jira JBESB-3882 to Closed Reproduced this on Windows using David B's suggestion (see FileUtilUnitTest.test_renameTo). |