Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If we can't parse a resource in the database, stop checking #957

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

robfletcher
Copy link
Contributor

After I promoted the change where we no longer check image resources, but instead check artifacts, we discovered that resource checking halted because Keel was no longer able to parse resources with ImageSpec payloads.

This change makes it so that if we hit that condition, we'll flag the resource as unreadable and stop checking it. That way resources we can handle will continue being processed.

Comment on lines 6 to 14
- addColumn:
tableName: resource_last_checked
columns:
- column:
name: unreadable
type: boolean
defaultValue: false
constraints:
nullable: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new DB column so we can just say "don't keep trying to check this"

@robfletcher

This comment has been minimized.

@robfletcher robfletcher force-pushed the handle-unreadable-resources branch 2 times, most recently from bc8bb1a to a256edf Compare April 1, 2020 22:17
}
} catch (e: TimeoutCancellationException) {
log.error("Timed out checking resource ${it.id}", e)
publisher.publishEvent(ResourceCheckTimedOut(it.kind, it.id, it.application))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the timeout metric currently appear on our keel dashboard? I don't think I've seen it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's pretty new and I don't believe it got added to the dashboard, no

@robfletcher robfletcher added the ready to merge Approved and ready for merge label Apr 1, 2020
Copy link
Contributor

@lorin lorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

constructResource(kind, metadata, spec)
} catch (e: Exception) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic will ignore updates regardless of the exception that occurs. I worry about situations where constructResource throws an exception for a transient issue (e.g., networking issue connecting with the database). Couple of thoughts around that:

  • We need to feed back info to a human being when a resource gets ignored. It should hopefully be rare enough that we can handle these as they come in. Since we're logging this as an error when it happens, I think we're good here, because we'll get alerted by RADAR.
  • Human operator needs to know how to fix things when a resource gets into a bad state due to a transient issue. Looks like the operation is simple enough (just set ignore to false in the database record), but we need to make sure everyone knows how to do this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Note that I saw we're logging as an error when the exception gets caught upstream, so no need to add any additional log statements).

@mergify mergify bot merged commit 7798642 into spinnaker:master Apr 1, 2020
@mergify mergify bot added the auto merged label Apr 1, 2020
@robfletcher robfletcher deleted the handle-unreadable-resources branch April 1, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged ready to merge Approved and ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants