diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2021-05-26 16:12:07 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-05-27 20:10:25 +0000 |
commit | 2fb8b360e3eb2252ea9c2e3f984f1ddd0130fc90 (patch) | |
tree | 9e42a317aded8a5d314c9f7aaafa65b014a1f6bd /server | |
parent | 08f4eab96ca208faf95770886f9f216293970e85 (diff) | |
download | sonarqube-2fb8b360e3eb2252ea9c2e3f984f1ddd0130fc90.tar.gz sonarqube-2fb8b360e3eb2252ea9c2e3f984f1ddd0130fc90.zip |
SONAR-14870 DNS cache never expires causing PR decoration to fail
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-process/src/main/java/org/sonar/process/SecurityManagement.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/SecurityManagement.java b/server/sonar-process/src/main/java/org/sonar/process/SecurityManagement.java index 7a2d32f4fc5..6c7c72f5bfe 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/SecurityManagement.java +++ b/server/sonar-process/src/main/java/org/sonar/process/SecurityManagement.java @@ -25,6 +25,7 @@ import java.security.PermissionCollection; import java.security.Permissions; import java.security.Policy; import java.security.ProtectionDomain; +import java.security.Security; import java.security.SecurityPermission; import java.util.Arrays; import java.util.HashSet; @@ -39,6 +40,8 @@ public class SecurityManagement { SecurityManager sm = new SecurityManager(); Policy.setPolicy(new CustomPolicy()); System.setSecurityManager(sm); + // SONAR-14870 By default, with a security manager installed, the DNS cache never times out. See InetAddressCachePolicy. + Security.setProperty("networkaddress.cache.ttl", "30"); } static class CustomPolicy extends Policy { |