-
Notifications
You must be signed in to change notification settings - Fork 574
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
ifacemgr: remove stale connections on startup #4968
ifacemgr: remove stale connections on startup #4968
Conversation
overlord/ifacestate/helpers.go
Outdated
} | ||
if staleConns > 0 { | ||
setConns(m.state, conns) | ||
logger.Noticef("remove %d stale connections", staleConns) |
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.
Nitpick: use past tense please, removed
. Alternatively we could log the actually deleted connections because after seeing this message I will only wonder, "gee which connections were removed?"
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.
LGTM but please add a unit test first.
There are some real test failures from unit tests affected by this feature:
|
We cannot land this before we fix the other bug (the one when snapd starts and there are no interfaces at all) because we would remove all of the stored connections in that case. |
Codecov Report
@@ Coverage Diff @@
## master #4968 +/- ##
==========================================
- Coverage 79.05% 79.03% -0.03%
==========================================
Files 489 489
Lines 36656 36684 +28
==========================================
+ Hits 28980 28993 +13
- Misses 5385 5394 +9
- Partials 2291 2297 +6
Continue to review full report at Codecov.
|
I don't think this is blocked anymore. We should merge mater to see that it passes and merge this branch. |
Remove stale conns left from old snapd releases at startup; I decided to do that in separate method rather than in reloadConnections to have it isolated.