felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Wightman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4924) ConfigAdmin update results in empty file or corrupt file.
Date Thu, 18 Jun 2015 12:38:00 GMT

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

Neil Wightman commented on FELIX-4924:
--------------------------------------

Yes its working fine. (on configadmin 1.8.0)

I'm concerned it could cause performance issues so I haven't pushed this fix to our customers
yet.

I wanted someone with more knowledge of configadmin to see if this fix could cause problems
or not.



> ConfigAdmin update results in empty file or corrupt file.
> ---------------------------------------------------------
>
>                 Key: FELIX-4924
>                 URL: https://issues.apache.org/jira/browse/FELIX-4924
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.4.0, configadmin-1.8.0
>         Environment: Windows Server 2003 + 2008.
> Redhat 
> Centos
>            Reporter: Neil Wightman
>
> We have been hitting a rare but consistent problem with config admin.
> The problem is that a config admin file is becoming corrupt.  I.e the file will contain
only NULL characters.  Last time this happened the config file had 1080 NULL characters in
it.
> This seems to occur when a config is being updated as the JVM is stopping / shutting
down.
> All the code in the FilePersistenceManager._store() method looks good and safe but this
issue still keeps occuring. 
> We it occur 3 times last week out of a few hundred servers.
> I think the problem is that the new File being written is not being flushed to disk in
time.
> I think ConfigAdmin needs to ensure the new config is flushed to disk after the close.
> {code}
>             tmpFile = File.createTempFile( cfgFile.getName(), TMP_EXT, cfgDir );
>             out = new FileOutputStream( tmpFile );
>             ConfigurationHandler.write( out, props );
>             out.close();
>             try 
>             {
>                 // attempt force to sync to disk
>                 out.getFD().sync();
>             }
>             catch (SyncFailedException sync) 
>             {
>                 // ignore
>             }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message