Fix Direct IO and drop cache silent failures on Ubuntu Linux#145
Draft
Fix Direct IO and drop cache silent failures on Ubuntu Linux#145
Conversation
Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix direct IO and drop cache command on Ubuntu
Fix Direct IO and drop cache silent failures on Ubuntu Linux
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Direct IO with the modern engine silently failed in jpackage DEB/RPM builds, and the
synccommand could be abandoned prematurely beforedrop_cachesran — both producing no visible error output.Root causes & fixes
jdk.unsupportedmissing from jpackage module list (build.xml)com.sun.nio.file.ExtendedOpenOption(used forO_DIRECT) is exported fromjdk.unsupported, which was absent from--add-modulesin bothcreate-fat-debandcreate-fat-rpmtargets. The bundled JRE threwNoClassDefFoundErrorat runtime — silently, becauseBenchmarkWorker.done()never calledget().InterruptedExceptionswallowed insync/drop_cachescommands (UtilOs.java)A lingering interrupt on the SwingWorker thread (e.g. from a prior cancellation) caused
process.waitFor()to throw immediately, abandoningsyncbefore it completed.flushDataToDriveLinux()anddropWriteCacheLinux()now retrywaitFor()in a loop on interruption and restore the interrupted status afterward.Null
FileChannelon Direct IOIOExceptionfallback (Sample.java)If
FileChannel.open()withExtendedOpenOption.DIRECTthrewIOException(e.g. filesystem doesn't supportO_DIRECT),initialFcwas left null and the subsequentfc.read()/fc.write()call threwNullPointerException— not caught by theIOExceptionhandler. BothmeasureWrite()andmeasureRead()now fall back to buffered IO with an explicit error message, matching the existingUnsupportedOperationExceptionpath.Silent exception swallowing in
BenchmarkWorker(BenchmarkWorker.java)done()never calledget(), so any exception fromdoInBackground()was silently discarded. Now logs and surfaces the error message to the user.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.