Skip to content

Commit

Permalink
fix(errors): don't log out an error on timeout (spinnaker#3751)
Browse files Browse the repository at this point in the history
Timeouts are pretty expected and are handled well in the UI, no need to throw an error into logs
This makes integration with, say, sentry, more sane as these timeouts won't show up as "issues"
  • Loading branch information
marchello2000 authored Jun 18, 2020
1 parent bbbce6f commit 4bc6045
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ class RunTaskHandler(
} else if (e is TimeoutException && stage.context["markSuccessfulOnTimeout"] == true) {
queue.push(CompleteTask(message, SUCCEEDED))
} else {
log.error("Error running ${message.taskType.simpleName} for ${message.executionType}[${message.executionId}]", e)
if (e !is TimeoutException) {
log.error("Error running ${message.taskType.simpleName} for ${message.executionType}[${message.executionId}]", e)
}

val status = stage.failureStatus(default = TERMINAL)
stage.context["exception"] = exceptionDetails
repository.storeStage(stage)
Expand Down Expand Up @@ -304,7 +307,7 @@ class RunTaskHandler(
msg.append("elapsedTime: ${formatTimeout(elapsedTime.toMillis())}, ")
msg.append("timeoutValue: ${formatTimeout(actualTimeout.toMillis())}")

log.warn(msg.toString())
log.info(msg.toString())
throw TimeoutException(msg.toString())
}
}
Expand Down

0 comments on commit 4bc6045

Please sign in to comment.