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

DEVPROD-12452 account for when the host was last provisioned when checking system failures #8491

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

ablack12
Copy link
Contributor

DEVPROD-12452

Description

Only quarantine a host if it's had three consecutive failures since it was last provisioned. Using provision time for this. Verified with https://evergreen.mongodb.com/rest/v2/hosts/ec2-3-89-114-149.compute-1.amazonaws.com that the field is what I'd expect.

Testing

Added unit testing

Documentation

remember to add or edit docs in the docs/ directory if relevant

@ablack12 ablack12 requested a review from a team November 22, 2024 18:51
or := ResourceTypeKeyIs(ResourceTypeHost)
or[TypeKey] = EventHostTaskFinished
or[ResourceIdKey] = hostId
func getRecentStatusesForHost(ctx context.Context, hostId string, hostProvisionTime time.Time, n int) (int, []string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we rename this to getRecentTaskFinishedStatusesForHost or something similar since this function ignores other host event logs

@@ -64,12 +66,13 @@ func getRecentStatusesForHost(ctx context.Context, hostId string, n int) (int, [
}

// AllRecentHostEventsAreSystemFailed returns true if all recent host events are system failures, and false if any are not.
func AllRecentHostEventsAreSystemFailed(ctx context.Context, hostId string, n int) bool {
// Only takes into account events that occurred since the last time the task started running.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: task finished events

@ablack12 ablack12 merged commit 5f4700e into evergreen-ci:main Nov 27, 2024
10 checks passed
@ablack12 ablack12 deleted the DEVPROD-12452 branch November 27, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants