-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update IOUtils.java #7620
Update IOUtils.java #7620
Conversation
Refactor code around file system to synchronously access file system when using JAR. Fixes grails/grails-core#12589
SonarCloud Quality Gate failed. |
If the file system is already created (FileSystemAlreadyExistsException above) because another thread also has it open, then closing it could break whatever operation that other thread is doing. This should not happen if the only thing accessing the URI is IOUtils, because of the Since this is about jar files, i.e. zipfs, I think it would be a better approach to use |
Needs to be tested to ensure nothing breaks in native |
I tried to run some basic smoke test for Micronaut graalvm native images and it seems to run fine. I will also try the my first graalvm app guide (https://guides.micronaut.io/latest/micronaut-creating-first-graal-app.html) today and share my findings here. |
This patch moves IOUtils zip handling to use `FileSystems.newFileSystem(Path, ...)` API instead of the URI-based method. The URI-based FS is shared globally, so it can lead to race conditions when opening/closing file systems. The Path-based FS is unshared and can be used safely. Additionally, this patch implements support for nested jar files. For Java 11+ this works with default zipfs, but earlier versions do not support zipfs nesting, so there's a fallback to extract the intermediate jar instead. Resolves #7620 Resolves #7626
This patch moves IOUtils zip handling to use `FileSystems.newFileSystem(Path, ...)` API instead of the URI-based method. The URI-based FS is shared globally, so it can lead to race conditions when opening/closing file systems. The Path-based FS is unshared and can be used safely. Additionally, this patch implements support for nested jar files. For Java 11+ this works with default zipfs, but earlier versions do not support zipfs nesting, so there's a fallback to extract the intermediate jar instead. Resolves #7620 Resolves #7626
Refactor code around file system to synchronously access file system when using JAR.
Fixes grails/grails-core#12589