]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8902 let thread interruptions fail the change log level webservice call
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Thu, 21 Sep 2017 11:57:31 +0000 (13:57 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 26 Sep 2017 21:49:38 +0000 (23:49 +0200)
server/sonar-server/src/main/java/org/sonar/server/platform/ws/ChangeLogLevelAction.java
server/sonar-server/src/main/java/org/sonar/server/platform/ws/ChangeLogLevelClusterService.java
server/sonar-server/src/main/java/org/sonar/server/platform/ws/ChangeLogLevelService.java

index a62a78962ecb2d9761126f4ed39a1f35196ff569..c65f35a8c396322c12403601e6d50ffd8e1f8598 100644 (file)
@@ -55,7 +55,7 @@ public class ChangeLogLevelAction implements SystemWsAction {
   }
 
   @Override
-  public void handle(Request wsRequest, Response wsResponse) {
+  public void handle(Request wsRequest, Response wsResponse) throws InterruptedException {
     userSession.checkIsSystemAdministrator();
 
     LoggerLevel level = LoggerLevel.valueOf(wsRequest.mandatoryParam(PARAM_LEVEL));
index 362fa62114e0daa92ff195575d7430d53e1228e6..e26cf710cf2cc4ac8e836a450f8c0c435f32ee83 100644 (file)
@@ -39,13 +39,9 @@ public class ChangeLogLevelClusterService implements ChangeLogLevelService {
     this.member = member;
   }
 
-  public void changeLogLevel(LoggerLevel level) {
-    try {
-      member.call(setLogLevelForNode(level), HazelcastMemberSelectors.selectorForProcessIds(ProcessId.WEB_SERVER, ProcessId.COMPUTE_ENGINE), CLUSTER_TIMEOUT_MILLIS)
-        .propagateExceptions();
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
+  public void changeLogLevel(LoggerLevel level) throws InterruptedException {
+    member.call(setLogLevelForNode(level), HazelcastMemberSelectors.selectorForProcessIds(ProcessId.WEB_SERVER, ProcessId.COMPUTE_ENGINE), CLUSTER_TIMEOUT_MILLIS)
+      .propagateExceptions();
   }
 
   private static DistributedCall<Object> setLogLevelForNode(LoggerLevel level) {
index 1ef59c76b7d74d7db233febfa28f39c0d7a6a4a8..6bf080af69515e00bb886085a44ca217df5dd15f 100644 (file)
@@ -23,6 +23,6 @@ import org.sonar.api.utils.log.LoggerLevel;
 
 public interface ChangeLogLevelService {
 
-  void changeLogLevel(LoggerLevel level);
+  void changeLogLevel(LoggerLevel level) throws InterruptedException;
 
 }