Skip to content

Conversation

@yanjunxiang-google
Copy link
Contributor

@yanjunxiang-google yanjunxiang-google commented Jan 12, 2026

There is a problem that during CDS update, the drop_overload in Envoy memory is wiped out. If EDS update never arrives, the drop_overload enforcement is lost, and only start to function after next EDS update arrives.
This PR fixes this issue by moving the drop_overload parsing logic to a common function update() which will cover both EDS succeeds cases and EDS timeout cases.

@yanjunxiang-google
Copy link
Contributor Author

/assign @yurykats

Signed-off-by: Yanjun Xiang <[email protected]>
@yanjunxiang-google
Copy link
Contributor Author

/assign @yanavlasov

void EdsClusterImpl::update(
const envoy::config::endpoint::v3::ClusterLoadAssignment& cluster_load_assignment) {
// Drop overload configuration parsing.
THROW_IF_NOT_OK(parseDropOverloadConfig(cluster_load_assignment));
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that since update() is void, it's not expected to be doing any error checking. Maybe just log that overload wasn't applied and move on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, we want to reject the bad configuration by throwing an exception. This follows the same logic as other EDS updates.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that throwing here should be discouraged.
It works (does not throw in a non-onConfigUpdate path) because the EDS resource is first validated before it is added to the cache, so the next call to this function when retrieving the cached EDS resource will not fail.

IMHO a better solution would be to refactor the function parseDropOverloadConfig so instead of both validating and updating the value, one would be able to validate and store the values separately. Then, the validation can be done in the onConfigUpdate() method, and the storing of the value can be done here in update().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Let's have a follow up PR to do the refactoring.

@yurykats
Copy link
Contributor

LGTM

@yanjunxiang-google
Copy link
Contributor Author

/assign @adisuissa

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

LGTM for now. Please add a release note.

void EdsClusterImpl::update(
const envoy::config::endpoint::v3::ClusterLoadAssignment& cluster_load_assignment) {
// Drop overload configuration parsing.
THROW_IF_NOT_OK(parseDropOverloadConfig(cluster_load_assignment));
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that throwing here should be discouraged.
It works (does not throw in a non-onConfigUpdate path) because the EDS resource is first validated before it is added to the cache, so the next call to this function when retrieving the cached EDS resource will not fail.

IMHO a better solution would be to refactor the function parseDropOverloadConfig so instead of both validating and updating the value, one would be able to validate and store the values separately. Then, the validation can be done in the onConfigUpdate() method, and the storing of the value can be done here in update().

yanavlasov
yanavlasov previously approved these changes Jan 14, 2026
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
adisuissa
adisuissa previously approved these changes Jan 14, 2026
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@yanjunxiang-google
Copy link
Contributor Author

/retest

@yanavlasov yanavlasov enabled auto-merge (squash) January 16, 2026 15:51
@yanavlasov yanavlasov merged commit 09603b0 into envoyproxy:main Jan 16, 2026
24 checks passed
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.

4 participants