jbonofre opened a new pull request, #3078:
URL: https://github.com/apache/karaf/pull/3078

   Backport of #3001 to `karaf-4.4.x`.
   
   ## Problem
   
   A crash or a storage failure while the features service saves its state 
could leave `state.json` or `digraph.json` truncated, since both were written 
in place. On the next start the features service fails to load them.
   
   ## Fix
   
   Same as #3001: each file is written to a temporary file of its own, synced 
to disk and then moved over the original atomically, through a new 
`FileUtils.atomicSave`. A failed digraph save is now logged instead of ignored.
   
   ## Differences from #3001
   
   None. The commit cherry-picked without conflicts. `org.apache.karaf.util` is 
already in the `features.core` bundle's `Private-Package` on this branch, so 
`FileUtils` is embedded as on `main`.
   
   ## Testing
   
   - [x] `mvn -pl util,features/core install` passes on this branch with JDK 11 
(24 tests in `util`, 129 in `features/core`), including the new 
`FileUtilsTest`, `ActivatorStateStorageTest` and `DigraphHelperTest`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to