Skip to content
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

Ensure worker-local fw_state reflects cleared global firewall state #250

Merged

Conversation

ol-imorozko
Copy link
Collaborator

The clearFWState() function clears global firewall state by invalidating all entries in the fw4_state and fw6_state hashtables via the clear() method. However, the worker-local fw_state, which caches firewall states for each worker, was not being updated to reflect these cleared entries. This led to inconsistencies where stale firewall state entries remained in the worker's fw_state cache, even though they had been cleared globally.

The issue arose because the handle_acl_gc() function only removed entries from fw_state based on timeout conditions. Entries that were invalidated by clearFWState() were skipped during garbage collection, as gc() only processes valid entries.

Updated handle_acl_gc() to explicitly check for invalidated entries (i.e., entries where the valid_mask has been cleared) during the gc() process. When such invalid entries are encountered, they are now added to fw_state_remove_stack, ensuring they are removed from the worker's fw_state cache.

The clearFWState() function clears global firewall state by invalidating all
entries in the fw4_state and fw6_state hashtables via the clear() method.
However, the worker-local fw_state, which caches firewall states for each worker,
was not being updated to reflect these cleared entries.
This led to inconsistencies where stale firewall state entries remained in the
worker's fw_state cache, even though they had been cleared globally.

The issue arose because the handle_acl_gc() function only removed entries from
fw_state based on timeout conditions. Entries that were invalidated by
clearFWState() were skipped during garbage collection, as gc() only processes
valid entries.

Updated handle_acl_gc() to explicitly check for invalidated entries
(i.e., entries where the valid_mask has been cleared) during the gc() process.
When such invalid entries are encountered, they are now added to
fw_state_remove_stack, ensuring they are removed from the worker's fw_state cache.
@ol-imorozko ol-imorozko linked an issue Sep 18, 2024 that may be closed by this pull request
@GeorgyKirichenko GeorgyKirichenko merged commit 014614b into yanet-platform:main Sep 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clearFWStep step in tests not clearing states
2 participants