Commit f889f6a
committed
do not use virtual threads when a SecurityManager is set
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)1 parent 92e1a5e commit f889f6a
File tree
1 file changed
+17
-5
lines changed- logback-core/src/main/java21/ch/qos/logback/core/util
1 file changed
+17
-5
lines changedLines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | | - | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | | - | |
50 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| |||
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
102 | | - | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
107 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
0 commit comments