You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some situations (e.g. program panic or abruptly terminated), a network namespace may be left unmounted, but with the namedPath still existing. I.e. the file system may be left with the file existing such as /run/netns/xyz but not mounted.
Further, going via a sequence of DeleteNamed() followed by NewNamed() does not resolve the situation since DeleteNamed() will not remove the file if not mounted (See code below). There seem to be no way to get the code to work in such a situation. As a minimal quick solution, I suggest modifying DeleteNamed from:
As a longer term, more complete solution, I would suggest adding mutex to protect this from ever happaning.
The text was updated successfully, but these errors were encountered:
davidhadas
changed the title
DeleteNamed - not clearing namedPath if mount does not exist
DeleteNamed() - not clearing namedPath if mount does not exist
Jun 1, 2024
A PR is most welcome. I'd vote for the longer term solution, whether that be a mutex or something else, but ideally preventing this sounds better than the brittleness of trying to do cleanup.
In some situations (e.g. program panic or abruptly terminated), a network namespace may be left unmounted, but with the namedPath still existing. I.e. the file system may be left with the file existing such as
/run/netns/xyz
but not mounted.Further, going via a sequence of DeleteNamed() followed by NewNamed() does not resolve the situation since DeleteNamed() will not remove the file if not mounted (See code below). There seem to be no way to get the code to work in such a situation. As a minimal quick solution, I suggest modifying DeleteNamed from:
to be:
As a longer term, more complete solution, I would suggest adding mutex to protect this from ever happaning.
The text was updated successfully, but these errors were encountered: