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

feat: __lbheartbeat__ will return 500 if the connection pool is exhausted #997

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Feb 2, 2021

Closes #996

Description

Return a 500 error if the connection pool is exhausted

Testing

Includes unit test

Issue(s)

Closes #996

@jrconlin jrconlin requested review from Micheletto and a team February 2, 2021 17:07
Copy link
Member

@pjenvey pjenvey left a comment

Choose a reason for hiding this comment

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

Would a combination of this and the previous method (checking intermittently in the pool periodic reporter but then ultimately reporting that status in the health check) potentially be more accurate?

Though I'm fine to try this assuming the probe can essentially do the same -- decide a pod is bad when this it sees lbheartbeat repeatedly report unhealthyness over some certain amount of time

Comment on lines 594 to +595
}
status_code = StatusCode::INTERNAL_SERVER_ERROR;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe only set the 500 status in an else block? Might be safer avoiding healthy nodes who happen to hit the max conns only once reporting 500 here.

Suggested change
}
status_code = StatusCode::INTERNAL_SERVER_ERROR;
} else {
status_code = StatusCode::INTERNAL_SERVER_ERROR;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that was the reasoning behind adding the duration_ms. I'm kinda/sorta ok if a saturated node returns a 500 early, because it can't really process more. Things reset fairly quickly once things become desaturated, and I think it takes multiple 500s returns before a node is terminated. We might want to talk with @Micheletto to see if that matches what he wants. I'd also be fine returning the 500 only after the saturation passes some Duration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Based off of conversations with ops, returning 500 immediately is preferred. Monitoring will only kill a node once multiple 500 reports in a row are detected.

@jrconlin jrconlin merged commit e72573a into master Feb 3, 2021
@jrconlin jrconlin deleted the feat/996-heartbeat branch February 3, 2021 00:02
Copy link

@Micheletto Micheletto left a comment

Choose a reason for hiding this comment

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

I know this is merged, but for the record: r+ from ops.

@jrconlin jrconlin mentioned this pull request Feb 3, 2021
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.

__lbheartbeat__ should return 500 if connection pool is exhausted
3 participants