monitor: skip state killing when no viable failover target exists#9833
Open
internetsecureORG wants to merge 1 commit intoopnsense:masterfrom
Open
monitor: skip state killing when no viable failover target exists#9833internetsecureORG wants to merge 1 commit intoopnsense:masterfrom
internetsecureORG wants to merge 1 commit intoopnsense:masterfrom
Conversation
Member
|
The code itself is snappy now. Nice job. In the grand scheme of things I don't know if this is wise as it prevents configured state killing in case the gateway really goes down and connections get stuck over an old gateway. But that was already mentioned. Spent a number of years cleaning up the code removing side effects. Feels like a step in the wrong direction to me especially since you stated your gateway is technically considered down by the default settings you did not want to change in #9789 as suggested. Cheers, |
Author
|
You're right, close/cancel this. I will regroup and see if I can come up with anything else. |
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.
Important notices
Describe the change
When a gateway goes down, the 20-recover monitor hook kills all states for that gateway — even when no other gateway is available to failover to. When the only other gateway and its interface are both disabled, this destroys active connections on the only working gateway with zero benefit, causing self-inflicted outages.
The system already acknowledges this situation in its own logs:
Yet it still kills states for WAN_DHCP immediately after.
The fix
Two lines added before the existing loop to pre-scan
return_gateways_status()for any non-down gateway. Oneifwrapper around the existing kill call to skip it when no viable target exists. No new functions, no new imports, no structural changes.When states are preserved, the decision is logged:
When a viable target does exist, behavior is completely unchanged.
Ref: #9789 (closed), previous PR #9823 (closed — this is a simplified resubmission with minimal changes)