Give service-runtime components more time to check in before failing an upgrade#15423
Give service-runtime components more time to check in before failing an upgrade#15423macdewee wants to merge 1 commit into
Conversation
…an upgrade Elastic Defend restarting slowly after an upgrade could be mistaken for a broken Agent build and trigger an unnecessary rollback. The FAILED threshold for service-runtime components is now derived from their own configured install/uninstall/check timeouts instead of the generic 90s window; DEGRADED reporting cadence is unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This pull request does not have a backport label. Could you fix it @macdewee? 🙏
|
TL;DRThe Remediation
Investigation detailsRoot Cause
Evidence
Validation
Follow-up
What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
💚 Build Succeeded
cc @macdewee |
What does this PR do?
Changes when a service-managed component (like Elastic Defend) gets marked as failed after it stops checking in. Before, any service component that missed check-ins for about 90 seconds was marked failed, no matter what. Now, the failure point is based on how long that component's own install/uninstall/check operations are allowed to take. For Elastic Defend that is 600 seconds, so it now gets up to 10 minutes instead of 90 seconds before being marked failed. If no such timeout is configured, the old 90 second behavior stays the same. The component still shows as degraded right away, so this is only about delaying the failed state, not hiding problems.
Why is it important?
Elastic Defend sometimes takes longer than 90 seconds to fully restart after an Agent upgrade, even when nothing is wrong. Agent was treating that normal slow restart as a broken upgrade and automatically rolling it back. This caused unnecessary rollbacks, and customers were working around it by removing Defend before upgrading and re-adding it afterward.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolI have added an integration test or an E2E testDisruptive User Impact
None expected. Service-managed components (currently only Elastic Defend) get more time before being marked failed, but only up to their own configured operation timeouts. Components that are genuinely stuck still end up failed, just later.
How to test this PR locally
Run
go test ./pkg/component/runtime/... -run TestServiceCheck -vto see the new unit tests covering: a normal check-in staying healthy, a slow-but-within-timeout check-in staying degraded instead of failed, a genuinely stuck component still ending up failed, and a component with no configured timeout keeping the old 90 second behavior.Related issues