Community
Participate
Working Groups
Our metadata files are written via IEclipsePreference#flush. If the disk is full this results in a zero length file (file is opened for write, which truncates the file, and then flushing stream fails). We should change either orion server code or IEclipsePreferences to use something like SafeFileOutputStream to avoid data loss in this case.
Ugh. We need to do everything possible to be bulletproof in the face of problems like this. If there is metadata that is critical, it needs to be written transaction style.
Yes. We have deliberately avoided investing in the server infrastructure so far. I have always thought for the server to be *real* it needs to plugin into a serious content repository for handling data persistence rather than writing something from scratch. For example we looked at Jackrabbit early on, but it felt overkill for a demo server. All I'm thinking of doing here is something as good as the Eclipse platform, which writes to a temp file first, and then renames the file if the write was successful. This helps with disk full and disk access errors while writing, but isn't true transaction semantics.
I think it is best to fix this at the Equinox preference level. Sample stack trace: java.io.IOException: No space left on device at java.io.FileOutputStream.writeBytes(Native Method) at java.io.FileOutputStream.write(FileOutputStream.java:266) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:117) at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:343) at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:404) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:147) at java.io.OutputStreamWriter.emptyBuffer(OutputStreamWriter.java:279) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:240) at java.io.Writer.write(Writer.java:152) at java.util.Properties.store(Properties.java:590) at org.eclipse.core.internal.preferences.EclipsePreferences.save(EclipsePreferences.java:1000) at org.eclipse.core.internal.preferences.EclipsePreferences.save(EclipsePreferences.java:968) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:353) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:341)
Fix released. http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=6ecef291a93bfad9cbdf13d23bad7cd5f4e438f1