Repository navigation
Remove incomplete native-library resources after extraction failure - #54
Draft
RicheyWorks wants to merge 1 commit into
Draft
RicheyWorks wants to merge 1 commit into
RicheyWorks wants to merge 1 commit into
Conversation
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.
If reading or writing a packaged native-library resource fails after extraction starts,
LibUtils.writeResourceToFileleaves a partial file behind. Later resource loads see that file as existing, skip extraction, and attempt to load the incomplete file. A transient extraction failure can therefore poison subsequent attempts using the same temp path.Track successful completion of copying/flush. After closing the streams, remove incomplete output created by this attempt when possible; log a warning if cleanup fails. Keep the original exception and preserve the existing rule that a pre-existing target is rejected without modifying it. Successful extraction remains unchanged.
Three no-CUDA tests use an isolated class loader to inject a resource stream that fails after four bytes, without adding production test hooks or loading any native library:
Validation: Maven/JUnit4.13.1, three tests, zero failures/errors/skips after the fix; baseline three tests with one failure. Windows/Temurin22, using the disclosed isolated parent source/target8 adaptation because upstream's Java7 target is rejected by this JDK. No POM changes, native DLLs, GPU tests, or system-property changes are included/needed.
This prevents new leftover partial files after a failed copy. It does not repair already-existing damaged files, introduce atomic cross-process extraction, or validate native-library loading on other platforms. Cleanup is best-effort when the filesystem refuses deletion.