Skip to content

fix: health check probes blocked indefinitely when EDS initialFetchTimeout is 0s - #46667

Closed
yuehaii wants to merge 4 commits into
envoyproxy:mainfrom
yuehaii:eds-initialFetchTimeout
Closed

yuehaii wants to merge 4 commits into
envoyproxy:mainfrom
yuehaii:eds-initialFetchTimeout

Conversation

@yuehaii

@yuehaii yuehaii commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Commit Message:
when a cluster is configured with EDS and initialFetchTimeout: 0s, the cluster stays in warming state indefinitely until EDS delivers its first response, no timeout fires to unblock it.

Additional Description:
added a bypass in ClusterImplBase::setHealthChecker(). when health_check_after_cluster_warming is enabled, health checks are still started immediately if both conditions hold:

  1. the EDS config source has initialFetchTimeout: 0s (hasZeroInitialFetchTimeout() == true)
  2. there are no pending SDS init targets (init_manager_.uninitializedCount() == 0)

Risk Level:
Low

Testing:
Test cases been added.

Release Notes:
fix health check probes being blocked indefinitely on EDS clusters configured with initialFetchTimeout: 0s. With health_check_after_cluster_warming enabled(default), health checks are no longer deferred when EDS warming has no timeout deadline.

Fixes #46666

…eck_after_cluster_warming is enabled

Signed-off-by: hai.yue <[email protected]>
Signed-off-by: hai.yue <[email protected]>
@yuehaii

yuehaii commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@adisuissa adisuissa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!
Can you clarify what is the expected behavior in the case where initial-fetch-timeout is 0, no EDS response was received for that cluster (the cluster is still warming), and there is a health-check request?
My understanding is that the health-check should just fail, as with any cluster that is in a warming state, correct?
Please add regression tests to make sure the correct behavior is maintained
/wait

@yuehaii

yuehaii commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks! Can you clarify what is the expected behavior in the case where initial-fetch-timeout is 0, no EDS response was received for that cluster (the cluster is still warming), and there is a health-check request? My understanding is that the health-check should just fail, as with any cluster that is in a warming state, correct? Please add regression tests to make sure the correct behavior is maintained /wait

with initialFetchTimeout: 0s, the cluster stays in warming state until EDS delivers endpoints.
when initialFetchTimeout is 0s, no timer fires, so onConfigUpdateFailed is never called. the cluster never exits warming via the timeout path, it must wait for EDS to actually deliver a response.

and there is a feature "envoy.reloadable_features.health_check_after_cluster_warming" declared with RUNTIME_GUARD which means it is enabled by default.

the feature "envoy.reloadable_features.health_check_after_cluster_warming" will be used as gate in setHealthChecker function which is called during cluster setup. If this feature off, the health checker will be start immediately.
this feature gate also used in onInitDone which is called after warming completes. if this feature on, the deferred health checker will be start.

so the health check probes didn't start until onInitDone(), which was blocked by 'initialFetchTimeout: 0s'. since no timer fires onConfigUpdateFailed to exits init warming.

I will add a regression test case soon.

… is more readable for a test case

Signed-off-by: hai.yue <[email protected]>
@yuehaii

yuehaii commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@adisuissa

Copy link
Copy Markdown
Contributor

with initialFetchTimeout: 0s, the cluster stays in warming state until EDS delivers endpoints. when initialFetchTimeout is 0s, no timer fires, so onConfigUpdateFailed is never called. the cluster never exits warming via the timeout path, it must wait for EDS to actually deliver a response.

and there is a feature "envoy.reloadable_features.health_check_after_cluster_warming" declared with RUNTIME_GUARD which means it is enabled by default.

the feature "envoy.reloadable_features.health_check_after_cluster_warming" will be used as gate in setHealthChecker function which is called during cluster setup. If this feature off, the health checker will be start immediately. this feature gate also used in onInitDone which is called after warming completes. if this feature on, the deferred health checker will be start.

so the health check probes didn't start until onInitDone(), which was blocked by 'initialFetchTimeout: 0s'. since no timer fires onConfigUpdateFailed to exits init warming.

I will add a regression test case soon.

I'm trying to understand the issue a bit deeper.
Is it that when the EDS resource is in warming state, a health-check is sent to that cluster, and the goal of the PR is to defer the sending of the health-check?

@yuehaii

yuehaii commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

I'm trying to understand the issue a bit deeper. Is it that when the EDS resource is in warming state, a health-check is sent to that cluster, and the goal of the PR is to defer the sending of the health-check?

It is not to defer. The fix added a bypass in ClusterImplBase::setHealthChecker():
when health_check_after_cluster_warming is enabled, health checks are still started immediately if both conditions hold:
1. The EDS config source has initialFetchTimeout: 0s (hasZeroInitialFetchTimeout() == true). So warming has no deadline
2. There are no pending SDS init targets (init_manager_.uninitializedCount() == 0). It preserves the original SDS safety guarantee from #43277

@adisuissa

Copy link
Copy Markdown
Contributor

It is not to defer. The fix added a bypass in ClusterImplBase::setHealthChecker(): when health_check_after_cluster_warming is enabled, health checks are still started immediately if both conditions hold: 1. The EDS config source has initialFetchTimeout: 0s (hasZeroInitialFetchTimeout() == true). So warming has no deadline 2. There are no pending SDS init targets (init_manager_.uninitializedCount() == 0). It preserves the original SDS safety guarantee from #43277

Would it be better marking the cluster as not-healthy, and not start a health-checker in this case of a warming cluster?
This way, one avoids spending timer resources when not needed, no?

@yuehaii

yuehaii commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Would it be better marking the cluster as not-healthy, and not start a health-checker in this case of a warming cluster?
This way, one avoids spending timer resources when not needed, no?

during warming, EDS hasn't delivered any endpoints. so there are zero hosts to mark unhealthy. the health checker would have nothing to probe regardless.
the current fix already avoids wasting timer resources. with zero endpoints, the health checker starts but schedules no timers. timers are created per host when hosts are added to the priority set, not at start() time. so there's no resource cost to starting early on an empty cluster.

@mathetake

Copy link
Copy Markdown
Member

ping @adisuissa

1 similar comment
@mathetake

Copy link
Copy Markdown
Member

ping @adisuissa

@adisuissa

Copy link
Copy Markdown
Contributor

Sorry, I'm still trying to understand what is the actual problem.

When the initial-fetch-timeout is set to 0, Envoy is waiting for the cluster's endpoints before marking the cluster as active. This is WAI and there isn't a problem there. In other words the cluster is not ready and should not be used.
When health-checks are used, they are not running because there are no endpoints to query. Does this somehow impact things badly?
Will it be possible to provide more information about the problem itself that is being observed?

@htuch

htuch commented Sep 8, 2026

Copy link
Copy Markdown
Member

@yuehaii can you address @adisuissa question?

@yuehaii

yuehaii commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

fix: initial fetch timed out for type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment envoyproxy/gateway#9713

I set EDS initialFetchTimeout: 0s in envoy gateway. After that, all those conformance and e2e test cases failure have the same pattern. they wait for health check activity to appear (in prometheus or loki) but the data never shows up within the timeout.

I was thinking the issue might be introduced by health_check_after_cluster_warming gate. l need to confirm more details.

/wait

@yuehaii

yuehaii commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

the blocking issue was caused by SDS InitialFetchTimeout: 0. the fix is currently under review. convert this pr to draft temporary.

@yuehaii
yuehaii marked this pull request as draft September 14, 2026 13:34
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

health check probes blocked indefinitely when EDS initialFetchTimeout is 0s

4 participants