Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4924

ConfigAdmin update results in empty file or corrupt file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • configadmin-1.4.0, configadmin-1.8.0
    • None
    • Configuration Admin
    • None
    • Windows Server 2003 + 2008.
      Redhat
      Centos

    Description

      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.

                  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
                  }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            neilwightman Neil Wightman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: