-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a thread to recreate the IPv6 firewall rule every 30 seconds to counteract the enforcer deleting it. #120
Conversation
…ounteract the enforcer deleting it.
|
||
def recreate_firewall_rule(): | ||
time.sleep(30) | ||
while self.firewall_rule_creation_should_stop is False: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use threading.Event
for inter-thread synchronization. The current approach may suffer from tearing.
source_range=self.firewall_source_range, | ||
source_range_ipv6=self.firewall_source_range_ipv6, | ||
) | ||
time.sleep(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could be done with a single call to time.sleep
source_range=self.firewall_source_range, | ||
source_range_ipv6=self.firewall_source_range_ipv6, | ||
) | ||
time.sleep(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the delay be pulled to a module-level constant? Also, 30 seems a bit slow to me. Maybe 10?
@@ -128,6 +134,22 @@ def test_dualstack(self) -> None: | |||
self.server_xds_host, self.server_xds_port | |||
) | |||
|
|||
with self.subTest("_start_firewall_rule_creation_thread"): | |||
|
|||
def recreate_firewall_rule(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this functionality is generally useful. Can we just incorporate it into the --ensure_firewall
flag?
No longer needed since the exemption is in place |
Short term fix to them not providing the exemption for the firewall rule.