Ubuntu whatever the latest.
Here is the 'guilty' code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public static void writeObjects(Path objectLocation, Serializable... obj) throws IOException { FileOutputStream st = new FileOutputStream(objectLocation.toFile()); try (ObjectOutputStream s = new ObjectOutputStream(new BufferedOutputStream(st, 20000))) { for (Serializable a : obj) { s.writeObject(a); } s.flush(); int counter = 0; while (counter++ < 5) { try { st.getFD().sync(); break; } catch (SyncFailedException e) { } } } } |
I added the sync and changed from Files.newOutputStream to fileoutputstream recently, not even sure if it helps (i know syncfailedexception happens sometimes because 'paradoxically' i was able to sometimes write the exception to the log i deleted since, if i tried the sync)
Also the the jvm is not being SIGKILL'ed (or halt'ed) - it's far too little time, i looked at the killing code in the init.d scripts in sendsigs and it has a 10 seconds maximum tolerance by checking for processes every second. Long before that happens the shutdown is progressing and the jvm dies a natural death.
I would expect umounting would flush the goddamned operating system buffers to disk.