[vnet] Add ref_count of router interfaces for vnet #1425
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.
What I did
Add ref_count of router interfaces for vnet.
Why I did it
Due to sequence problems or other reasons, deleting a vnet earlier than deleting the interface bound to this vnet will cause an error.
Aug 26 15:00:35.521764 leaf-237 ERR swss#orchagent: :- meta_generic_validation_remove: object 0x3000000000938 reference count is 1, can't remove
Aug 26 15:00:35.522349 leaf-237 ERR swss#orchagent: :- ~VNetVrfObject: Failed to remove virtual router name: Vnet1, rv:-5
How I verified it
add Vnet1
bind Ethernet1 to Vnet1
remove Vnet1
remove Ethernet1