do not use virtual threads when a SecurityManager is set - #821
Open
sdusart wants to merge 2 commits into
Open
Conversation
sdusart
force-pushed
the
jdk21_with_security_manager
branch
from
June 12, 2024 14:29
a3f5684 to
2f54d93
Compare
sdusart
force-pushed
the
jdk21_with_security_manager
branch
from
September 19, 2024 12:37
2f54d93 to
f889f6a
Compare
sdusart
force-pushed
the
jdk21_with_security_manager
branch
from
October 24, 2024 14:16
f889f6a to
5578bed
Compare
When running with a SecurityManager set, virtual threads have no permissions (https://openjdk.org/jeps/444). => Virtual threads must not be used otherwise AccessControlExceptions will be raised during file manipulations. 09:50:57,825 |-ERROR in c.q.l.core.rolling.TimeBasedRollingPolicy@1645547422 - Unexpected exception while waiting for compression job to finish java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read") at java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read") at at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205) at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.waitForAsynchronousJobToStop(TimeBasedRollingPolicy.java:140) at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.stop(TimeBasedRollingPolicy.java:132) at at ch.qos.logback.core.rolling.RollingFileAppender.stop(RollingFileAppender.java:159) at at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107) at at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:209) at at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:333) at at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:340) at at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:363) at at ch.qos.logback.classic.LoggerContext.stop(LoggerContext.java:343) at at org.springframework.boot.logging.logback.LogbackLoggingSystem.lambda$getShutdownHandler$2(LogbackLoggingSystem.java:391) at at java.base/java.lang.Iterable.forEach(Iterable.java:75) at at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:116) at at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read") at at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488) at at java.base/java.security.AccessController.checkPermission(AccessController.java:1071) at at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411) at at java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:742) at at java.base/java.io.File.exists(File.java:831) at at ch.qos.logback.core.rolling.helper.Compressor.gzCompress(Compressor.java:148) at at ch.qos.logback.core.rolling.helper.Compressor.compress(Compressor.java:57) at at ch.qos.logback.core.rolling.helper.Compressor$CompressionRunnable.run(Compressor.java:246) at at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)
sdusart
force-pushed
the
jdk21_with_security_manager
branch
from
November 21, 2024 13:22
5578bed to
ae29de2
Compare
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.
When running with a SecurityManager set, virtual threads have no permissions (https://openjdk.org/jeps/444).
=> Virtual threads must not be used otherwise AccessControlExceptions will be raised during file manipulations.
09:50:57,825 |-ERROR in c.q.l.core.rolling.TimeBasedRollingPolicy@1645547422 - Unexpected exception while waiting for compression job to finish java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read")
at java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read")
at at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.waitForAsynchronousJobToStop(TimeBasedRollingPolicy.java:140)
at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.stop(TimeBasedRollingPolicy.java:132)
at at ch.qos.logback.core.rolling.RollingFileAppender.stop(RollingFileAppender.java:159)
at at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107)
at at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:209)
at at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:333)
at at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:340)
at at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:363)
at at ch.qos.logback.classic.LoggerContext.stop(LoggerContext.java:343)
at at org.springframework.boot.logging.logback.LogbackLoggingSystem.lambda$getShutdownHandler$2(LogbackLoggingSystem.java:391)
at at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:116)
at at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/path/to/logs/business.2024-06-12-0949.log8596119935863.tmp" "read")
at at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488)
at at java.base/java.security.AccessController.checkPermission(AccessController.java:1071)
at at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411)
at at java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:742)
at at java.base/java.io.File.exists(File.java:831)
at at ch.qos.logback.core.rolling.helper.Compressor.gzCompress(Compressor.java:148)
at at ch.qos.logback.core.rolling.helper.Compressor.compress(Compressor.java:57)
at at ch.qos.logback.core.rolling.helper.Compressor$CompressionRunnable.run(Compressor.java:246)
at at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)