Skip to content

Commit

Permalink
1.30.1 v8.31.1 monitor front50 task (#40)
Browse files Browse the repository at this point in the history
* Bugfix added configurable timeout value for MonitorFront50Task

* OP-20611: Bugfix added configurable timeout value for save pipeline task timeout
  • Loading branch information
sudhakaropsmx authored Jul 14, 2023
1 parent e2f6530 commit 6f3ac42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ public long getBackoffPeriod() {
return TimeUnit.SECONDS.toMillis(5);
}

@Value("${tasks.monitor-front50.timeout-millis:90000}")
private long timeout;

@Override
public long getTimeout() {
return TimeUnit.SECONDS.toMillis(90);
log.debug("MonitorFront50Task timeout-millis :{}", timeout);
return timeout;
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import com.netflix.spinnaker.orca.front50.PipelineModelMutator;
import com.netflix.spinnaker.orca.front50.pipeline.SavePipelineStage;
import java.util.*;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import retrofit.client.Response;
Expand All @@ -55,6 +55,7 @@ public class SavePipelineTask implements RetryableTask {
@SuppressWarnings("unchecked")
@Override
public TaskResult execute(StageExecution stage) {
log.debug("****************Start of the Save Pipeline Task");
if (front50Service == null) {
throw new UnsupportedOperationException(
"Front50 is not enabled, no way to save pipeline. Fix this by setting front50.enabled: true");
Expand Down Expand Up @@ -128,6 +129,12 @@ public TaskResult execute(StageExecution stage) {
status = ExecutionStatus.TERMINAL;
}
}
log.info(
"*******application {} Save Pipeline {} of status {}",
pipeline.get("application"),
pipeline.get("name"),
status);
log.info("****************End of the Save Pipeline Task");
return TaskResult.builder(status).context(outputs).build();
}

Expand All @@ -136,9 +143,13 @@ public long getBackoffPeriod() {
return 1000;
}

@Value("${tasks.save-pipeline.timeout-millis:30000}")
private long timeout;

@Override
public long getTimeout() {
return TimeUnit.SECONDS.toMillis(30);
log.debug("SavePipelineTask timeout-millis :{}", timeout);
return timeout;
}

private void updateServiceAccount(Map<String, Object> pipeline, String serviceAccount) {
Expand Down

0 comments on commit 6f3ac42

Please sign in to comment.