ROX-32420: Add relay vsock retry when KubeVirt is unavailable#19391
Draft
ROX-32420: Add relay vsock retry when KubeVirt is unavailable#19391
Conversation
When StackRox starts before KubeVirt, the VM relay's vsock bind fails once and never retries, leaving the relay disabled for the pod lifetime. Add exponential backoff retry around stream creation so the relay recovers when vsock becomes available after KubeVirt is installed. - Extract createVMRelayStreamWithRetry() with context-aware retry loop - Add stream.NewWithListener() for tests - Add unit tests for retry success, cancellation, and immediate success - Document bind-failure flow in compliance, stream, and vsock packages AI-generated: retry logic, tests, NewWithListener, and documentation. User-reviewed: design and implementatio.
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
Contributor
|
Images are ready for the commit at e56dae0. To use with deploy scripts, first |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19391 +/- ##
==========================================
- Coverage 49.68% 49.60% -0.09%
==========================================
Files 2700 2702 +2
Lines 203278 203655 +377
==========================================
+ Hits 100999 101013 +14
- Misses 94753 95116 +363
Partials 7526 7526
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR removes a timing dependency in VM relay startup when StackRox starts before KubeVirt with vsock support is installed.
Before:
vsockbind during startup.After:
Code changes:
createVMRelayStreamWithRetry(...)incomplianceand use it from VM relay startup path.stream.NewWithListener(...)test helper constructor for deterministic stream tests without real vsock.AI-assisted contribution:
User-facing documentation
Testing and quality
Automated testing
How I validated my change