ROX-31236: Remove ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT flag#17236
ROX-31236: Remove ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT flag#17236
ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT flag#17236Conversation
This removes the ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT feature flag that has been enabled by default since Release 4.2 (Dec 2023). The feature flag enabled Sensor to maintain connection retries with Central instead of restarting the entire Sensor process on disconnect. This behavior is now the standard and only operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Simplified sensor Start() to always use connection retry logic - Simplified sensor Stop() to use the retry-aware stop mechanism - Removed feature flag setup from 3 integration tests (runtime, reconciliation, alerts) The retry-enabled behavior is preserved as the default and only mode. Tests continue to validate reconnection scenarios without needing explicit feature flag enablement. Partially generated with AI assistance.
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 0915659. To use with deploy scripts, first |
The communicationWithCentral function was no longer called after removing the feature flag conditional logic. This fixes the golangci-lint unused function warning.
This document provides the detailed analysis and implementation plan for removing the ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT feature flag.
This document is for reference only and should not be part of the codebase.
ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT flag
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17236 +/- ##
==========================================
+ Coverage 48.81% 48.84% +0.03%
==========================================
Files 2717 2717
Lines 203219 203182 -37
==========================================
+ Hits 99200 99251 +51
+ Misses 96196 96114 -82
+ Partials 7823 7817 -6
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 removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Remove any remaining references to ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT in documentation, scripts, and config templates to avoid confusion.
- Since the retry logic is now the only execution path, consider renaming communicationWithCentralWithRetries to a more generic name (e.g., startCentralCommunication) for clarity.
- Clean up or update any stale log messages and metrics around the old restart-on-disconnect behavior so they accurately reflect the current retry‐only flow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Remove any remaining references to ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT in documentation, scripts, and config templates to avoid confusion.
- Since the retry logic is now the only execution path, consider renaming communicationWithCentralWithRetries to a more generic name (e.g., startCentralCommunication) for clarity.
- Clean up or update any stale log messages and metrics around the old restart-on-disconnect behavior so they accurately reflect the current retry‐only flow.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
I checked for that and it should be done.
I would like to keep the changes minimal and don't do the refactoring when only removal of FF was planned. I think the name is still fine.
I didn't see any. If there is something to clean up, let me know. |
|
@vikin91: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
This removes the ROX_CAPTURE_INTERMEDIATE_EVENTS feature flag that has been enabled by default since Release 4.3 (February 2024). The flag enabled offline v3 behavior where Sensor buffers events during Central disconnects. This is now the standard operational mode. Changes: - Removed feature flag definition from pkg/features/list.go - Network flow manager: Always use buffered channels and continue enrichment during offline mode - Process signal pipeline: Always use long-lived contexts that persist across disconnects - Detector: Always use buffered queues and handle pause/resume on connection events - Removed EnrichmentReasonEpFeatureDisabled (no longer returned) - Updated integration tests to remove flag setup - Removed unused features package imports from 9 files All event buffering and offline operation functionality remains fully operational. This PR is stacked on #17236 (ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT removal). Partially generated with AI assistance.
Human here
This has been created fully by AI. I have checked the code changes and the PR description.
The description could have been more compact, but I think the goal of this PR is clear.
Description
This PR removes the
ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECTfeature flag that has been enabled by default since Release 4.2 (December 2023).📋 Detailed Implementation Plan: REMOVAL_PLAN_PREVENT_SENSOR_RESTART.md
Why is this safe to remove?
unchangeableInProd- cannot be disabled in productionROX_CAPTURE_INTERMEDIATE_EVENTSandROX_SENSOR_RECONCILIATIONChanges made:
pkg/features/list.goStart()to always use connection retry logicStop()to use retry-aware stop mechanismcommunicationWithCentralfunctionThe retry-enabled behavior is now the only operational mode. The legacy "restart-on-disconnect" code path has been completely removed.
PR Stacking Context
This is the first PR of a 4-PR feature flag cleanup sequence:
ROX_PREVENT_SENSOR_RESTART_ON_DISCONNECT(foundation layer)ROX_AUTH_MACHINE_TO_MACHINE(independent)ROX_CAPTURE_INTERMEDIATE_EVENTS(depends on this)ROX_SENSOR_RECONCILIATION(depends on first and third PRs)User-facing documentation
Testing and quality
Automated testing
How I validated my change
unchangeableInProdconstraintSuggested Reviewers