diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-08-30 16:30:55 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-09-05 14:24:13 +0200 |
commit | a228919e41902d87b3d4d73892ed8e849375fb85 (patch) | |
tree | c2a9129a0aa93d85821992d3fe952f8639f415e2 | |
parent | c9f779dc009b42cf8e1bc5c5a335462be0c3e971 (diff) | |
download | sonarqube-a228919e41902d87b3d4d73892ed8e849375fb85.tar.gz sonarqube-a228919e41902d87b3d4d73892ed8e849375fb85.zip |
SONAR-9715 use realistic JSW timouts
5 files changed, 10 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java index 9348e275e49..cf395d10e34 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java @@ -20,6 +20,7 @@ package org.sonar.server.ce.ws; import com.google.common.base.Optional; +import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; @@ -69,6 +70,8 @@ public class ActivityStatusAction implements CeWsAction { action.createParam(PARAM_COMPONENT_KEY) .setDescription("Key of the component (project) to filter on") .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001); + + action.setChangelog(new Change("6.6", "New field 'inProgress' in response")); } @Override @@ -83,10 +86,12 @@ public class ActivityStatusAction implements CeWsAction { String componentUuid = component.isPresent() ? component.get().uuid() : null; checkPermissions(component); int pendingCount = dbClient.ceQueueDao().countByStatusAndComponentUuid(dbSession, CeQueueDto.Status.PENDING, componentUuid); + int inProgressCount = dbClient.ceQueueDao().countByStatusAndComponentUuid(dbSession, CeQueueDto.Status.IN_PROGRESS, componentUuid); int failingCount = dbClient.ceActivityDao().countLastByStatusAndComponentUuid(dbSession, CeActivityDto.Status.FAILED, componentUuid); return ActivityStatusWsResponse.newBuilder() .setPending(pendingCount) + .setInProgress(inProgressCount) .setFailing(failingCount) .build(); } diff --git a/server/sonar-server/src/main/resources/org/sonar/server/ce/ws/activity_status-example.json b/server/sonar-server/src/main/resources/org/sonar/server/ce/ws/activity_status-example.json index c57d76edd38..4cd59c63dd6 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/ce/ws/activity_status-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/ce/ws/activity_status-example.json @@ -1,4 +1,5 @@ { "pending": 2, + "inProgress": 1, "failing": 5 } diff --git a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java index 979c171c1d2..01b223801ab 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java @@ -66,6 +66,7 @@ public class ActivityStatusActionTest { public void json_example() { dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-1").setStatus(CeQueueDto.Status.PENDING)); dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-2").setStatus(CeQueueDto.Status.PENDING)); + dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-3").setStatus(CeQueueDto.Status.IN_PROGRESS)); for (int i = 0; i < 5; i++) { dbClient.ceActivityDao().insert(dbSession, new CeActivityDto(newCeQueueDto("ce-activity-uuid-" + i)) .setStatus(CeActivityDto.Status.FAILED)); diff --git a/sonar-application/src/main/assembly/conf/wrapper.conf b/sonar-application/src/main/assembly/conf/wrapper.conf index 64d66eacbdb..3f37ed2fb46 100644 --- a/sonar-application/src/main/assembly/conf/wrapper.conf +++ b/sonar-application/src/main/assembly/conf/wrapper.conf @@ -85,5 +85,5 @@ wrapper.ntservice.interactive=false #******************************************************************** wrapper.disable_restarts=TRUE wrapper.ping.timeout=0 -wrapper.shutdown.timeout=3000 -wrapper.jvm_exit.timeout=3000 +wrapper.shutdown.timeout=300 +wrapper.jvm_exit.timeout=15 diff --git a/sonar-ws/src/main/protobuf/ws-ce.proto b/sonar-ws/src/main/protobuf/ws-ce.proto index dd869eaa1c3..a268b7bcbd6 100644 --- a/sonar-ws/src/main/protobuf/ws-ce.proto +++ b/sonar-ws/src/main/protobuf/ws-ce.proto @@ -48,6 +48,7 @@ message ActivityResponse { message ActivityStatusWsResponse { optional int32 pending = 1; optional int32 failing = 2; + optional int32 inProgress = 3; } // GET api/ce/component |