Remove redundant plumb_service_firewall_rules call from rack_initialize#9764
Merged
Remove redundant plumb_service_firewall_rules call from rack_initialize#9764
Conversation
This call was added in March 2024 (05ed790) to ensure firewall rules are plumbed during initial rack setup. However, in May 2024 (f2602b5), await_ip_allowlist_plumbing() was added to Server::start() to ensure the allowlist is enforced before the external HTTP server starts. This created redundancy: in the test/RSS path, rack_initialize() plumbs the rules, then Server::start() immediately re-plumbs them via await_ip_allowlist_plumbing(). Removing the call from rack_initialize() is safe because: 1. await_ip_allowlist_plumbing() handles both fresh rack and restart: - Fresh rack: rules plumbed before external server starts - Restart: rules re-plumbed before external server starts 2. The call in rack_initialize() has no unique purpose - the external server doesn't start until AFTER await_ip_allowlist_plumbing() anyway 3. Order is preserved: - Allowlist written to DB in rack_initialize() (unchanged) - Rules plumbed to sleds in await_ip_allowlist_plumbing() (unchanged) - External server starts AFTER plumbing completes (unchanged) 4. Background task (ServiceRulePropagator) provides additional safety, periodically re-plumbing rules every 5 minutes Also removes the now-unused Nexus::plumb_service_firewall_rules wrapper method from sled.rs, since all callers use nexus_networking:: directly. Saves ~400ms in nexus test setup time.
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.
This call was added in March 2024 (05ed790) to ensure firewall rules are plumbed during initial rack setup. However, in May 2024 (f2602b5), await_ip_allowlist_plumbing() was added to Server::start() to ensure the allowlist is enforced before the external HTTP server starts.
This created redundancy: in the test/RSS path, rack_initialize() plumbs the rules, then Server::start() immediately re-plumbs them via await_ip_allowlist_plumbing().
Removing the call from rack_initialize() is safe because:
await_ip_allowlist_plumbing() handles both fresh rack and restart:
The call in rack_initialize() has no unique purpose - the external server doesn't start until after await_ip_allowlist_plumbing() anyway
Order is preserved:
Also removes the now-unused Nexus::plumb_service_firewall_rules wrapper method from sled.rs, since all callers use nexus_networking:: directly.
Saves ~400ms in nexus test setup time.