-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Fix the Inactivity Expiration problem. #2865
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
@pascal-fischer This fix solves multiple problems. The value I add here, if there is a new value, we overwrite the old value. Because when the scheduled task runs, it always considers the old value as valid and triggers the scheduled task at the old time. netbird/management/server/account.go Line 1193 in 156fa32
The method triggering order is as follows.
netbird/management/server/account.go Lines 1273 to 1279 in 669904c
The value “a.Settings.PeerInactivityExpiration” contains the old value. netbird/management/server/account.go Line 650 in 669904c
|
I also recommend you to look carefully at the old code. Even if you set “PeerInactivityExpirationEnabled” to false, the timer continues to be triggered if there is a different “PeerInactivityExpiration” value. There seems to be a bug here.
|
This is the test code that gives an error. The default values given when calling “manager.UpdateAccountSettings” are (PeerInactivityExpirationEnabled: false) and (PeerInactivityExpiration: 0). But in the current peer, these values are set to "true" and "10 minutes". Therefore, even if you set “PeerInactivityExpirationEnabled” to false, the “PeerInactivityExpiration” value is triggered. netbird/management/server/account_test.go Lines 1898 to 1944 in 669904c
|
This ensures that “PeerInactivityExpirationEnabled” is only triggered when true. It also makes the new value “PeerInactivityExpiration” work. |
Okay, you have me convinced. The |
Describe your changes
Even if inactivity is disabled before the change, the scheduled method can still be triggered. The method is never triggered when inactivity is disabled after the change. This is necessary to solve the error problem of SQL Tests.
Checklist