Skip to content

Commit

Permalink
chore(logging): quiesce jardiff and commit tasks noisy error logs (#3832
Browse files Browse the repository at this point in the history
)

These aren't errors, so make them warnings instead

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
marchello2000 and mergify[bot] committed Jul 23, 2020
1 parent 20fbb60 commit 14fb0f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class JarDiffsTask implements DiffTask {
targetInstances = oortHelper.getInstancesForCluster(stage.context, targetAsg, false, false)
sourceInstances = oortHelper.getInstancesForCluster(stage.context, sourceAsg, false, false)
} catch (Exception e) {
log.error("Unable to fetch instances (targetAsg: ${targetAsg}, sourceAsg: ${sourceAsg}), reason: ${e.message}")
log.warn("Unable to fetch instances (targetAsg: ${targetAsg}, sourceAsg: ${sourceAsg}), reason: ${e.message}", e)
}

if (!targetInstances || !sourceInstances) {
Expand All @@ -108,7 +108,7 @@ class JarDiffsTask implements DiffTask {
return TaskResult.builder(ExecutionStatus.SUCCEEDED).context([jarDiffs: jarDiffs]).build()
} catch (Exception e) {
// return success so we don't break pipelines
log.error("error while fetching jar diffs, retrying", e)
log.warn("error while fetching jar diffs, retrying", e)
return TaskResult.builder(ExecutionStatus.RUNNING).context([jarDiffsRetriesRemaining: --retriesRemaining]).build()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ class GetCommitsTask implements DiffTask {
} catch (RetrofitError e) {
if (e.kind == RetrofitError.Kind.UNEXPECTED) {
// give up on internal errors
log.error("internal error while talking to igor : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:$sourceInfo targetCommit: $targetInfo]")
log.warn("internal error while talking to igor : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:$sourceInfo targetCommit: $targetInfo]", e)
return TaskResult.builder(ExecutionStatus.SUCCEEDED).context([commits: []]).build()
} else if (e.response?.status == 404) {
// just give up on 404
log.error("got a 404 from igor for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}]")
log.warn("got a 404 from igor for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}]", e)
return TaskResult.builder(ExecutionStatus.SUCCEEDED).context([commits: []]).build()
} else { // retry on other status codes
log.error("retrofit error (${e.message}) for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying")
log.warn("retrofit error (${e.message}) for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying", e)
return TaskResult.builder(ExecutionStatus.RUNNING).context([getCommitsRetriesRemaining: retriesRemaining - 1]).build()
}
} catch (Exception f) { // retry on everything else
log.error("unexpected exception for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying", f)
log.warn("unexpected exception for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying", f)
return TaskResult.builder(ExecutionStatus.RUNNING).context([getCommitsRetriesRemaining: retriesRemaining - 1]).build()
} catch (Throwable g) {
log.error("unexpected throwable for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying", g)
log.warn("unexpected throwable for : [repoType: ${repoInfo?.repoType} projectKey:${repoInfo?.projectKey} repositorySlug:${repoInfo?.repositorySlug} sourceCommit:${sourceInfo} targetCommit: ${targetInfo}], retrying", g)
return TaskResult.builder(ExecutionStatus.RUNNING).context([getCommitsRetriesRemaining: retriesRemaining - 1]).build()
}
}
Expand Down

0 comments on commit 14fb0f4

Please sign in to comment.