summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-10-11 12:47:43 +0200
committerjonmv <venstad@gmail.com>2022-10-11 12:47:43 +0200
commitb0c65e09beeb62e33cf9160c9408a3382c6f1328 (patch)
tree3d5735f1d9a0b4d1c653fcc3566aa90e2ddbbdf5 /controller-server
parent6ddc05137b76e149de29692eda592ff9b2f2dab7 (diff)
Clear notifications when ending jobs that are no longer declared
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index 46c93c019ee..e685e5d167e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -77,6 +77,7 @@ import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.noTests;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.nodeAllocationFailure;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.reset;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.running;
+import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.success;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.testFailure;
import static com.yahoo.vespa.hosted.controller.deployment.Step.Status.succeeded;
import static com.yahoo.vespa.hosted.controller.deployment.Step.copyVespaLogs;
@@ -763,14 +764,18 @@ public class InternalStepRunner implements StepRunner {
private Optional<RunStatus> report(RunId id, DualLogger logger) {
try {
+ boolean isRemoved = ! id.type().environment().isManuallyDeployed()
+ && ! controller.jobController().deploymentStatus(controller.applications().requireApplication(TenantAndApplicationId.from(id.application())))
+ .jobSteps().containsKey(id.job());
+
controller.jobController().active(id).ifPresent(run -> {
if (run.status() == reset)
return;
- if (run.hasFailed())
+ if (run.hasFailed() && ! isRemoved)
sendEmailNotification(run, logger);
- updateConsoleNotification(run);
+ updateConsoleNotification(run, isRemoved);
});
}
catch (IllegalStateException e) {
@@ -820,10 +825,10 @@ public class InternalStepRunner implements StepRunner {
.orElse(true);
}
- private void updateConsoleNotification(Run run) {
+ private void updateConsoleNotification(Run run, boolean isRemoved) {
NotificationSource source = NotificationSource.from(run.id());
Consumer<String> updater = msg -> controller.notificationsDb().setNotification(source, Notification.Type.deployment, Notification.Level.error, msg);
- switch (run.status()) {
+ switch (isRemoved ? success : run.status()) {
case aborted: return; // wait and see how the next run goes.
case noTests:
case running: