You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2013/08/14 09:57:49 UTC

[jira] [Commented] (FELIX-4165) FilePersistenceManager fails to rename configuration file

    [ https://issues.apache.org/jira/browse/FELIX-4165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13739373#comment-13739373 ] 

Felix Meschberger commented on FELIX-4165:
------------------------------------------

Thanks for reporting the issue.

I have added a check for the result of the delete operation in Rev. 1513753. Unfortunately Java just reports success or failure. So, the only thing that can be done at that level is to throw an IOException and fail the store operation.

The reason for failure to delete a file (or rename a file by that matter) on windows is generally related to the file still being open. Both should not be the case to the best of my knowledge here.

As for your follow-up comment: The code extract is unrelated to the original report. But you mention, that an IOException should be thrown here instead of catching and logging it. I disagree in this context because the factory.store() operation is an internal maintenance task not related to the actual creation of a factory configuration. As such me thinks this exception should not exposed to the consumer because the consumer can do even less. In addition, regardless of the success or failure in this particular situation, the task of the consumer (creating a factory configuration) has been done.
                
> FilePersistenceManager fails to rename configuration file
> ---------------------------------------------------------
>
>                 Key: FELIX-4165
>                 URL: https://issues.apache.org/jira/browse/FELIX-4165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.6.0
>            Reporter: Martin Lichtin
>            Assignee: Felix Meschberger
>             Fix For: configadmin-1.6.2
>
>
> Quite frequently a file move fails. The symptom is:
> java.io.IOException: Failed to rename configuration file from 'C:\Users\mli\nuc\env\master\karaf\karaf\karaf-deploy-std\target\karaf\data\cache\bundle5\data\config\org_apache_felix_cm_impl_DynamicBindings.config2019338524809240991.tmp' to 'C:\Users\mli\nuc\env\master\karaf\karaf\karaf-deploy-std\target\karaf\data\cache\bundle5\data\config\org_apache_felix_cm_impl_DynamicBindings.config
> 	at org.apache.felix.cm.file.FilePersistenceManager._store(FilePersistenceManager.java:640)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.file.FilePersistenceManager.store(FilePersistenceManager.java:582)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.DynamicBindings.putLocation(DynamicBindings.java:116)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.ConfigurationManager.setDynamicBundleLocation(ConfigurationManager.java:461)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.ConfigurationImpl.setDynamicBundleLocation(ConfigurationImpl.java:281)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.ConfigurationImpl.tryBindLocation(ConfigurationImpl.java:304)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1705)[5:org.apache.felix.configadmin:1.6.0]
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)[5:org.apache.felix.configadmin:1.6.0]
> 	at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]
> Perhaps the file exists and cannot be deleted (could report return value of the delete() on line 634).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira