Skip to content
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

multiple sessions on same host remove namespaces that are still in use #175

Open
ak-1 opened this issue Jul 18, 2022 · 7 comments
Open

multiple sessions on same host remove namespaces that are still in use #175

ak-1 opened this issue Jul 18, 2022 · 7 comments
Labels
bug Something isn't working important An important issue that should be resolved quickly

Comments

@ak-1
Copy link
Contributor

ak-1 commented Jul 18, 2022

Running a second session in parallel on the same host currently removes the namespace of the other running vopono session:

DEBUG vopono::util > Existing namespaces: ["vopono_..."]
DEBUG vopono::util > Removing dead namespace: vopono_...
DEBUG vopono::util > ip netns delete vopono_...
@jamesmcm
Copy link
Owner

Could you please add more details about what that namespace is running?

In theory it uses the PID to check but this might be problematic if the process forks such that the original PID isn't running anymore.

@jamesmcm jamesmcm added bug Something isn't working important An important issue that should be resolved quickly labels Jul 19, 2022
@ak-1
Copy link
Contributor Author

ak-1 commented Jul 19, 2022

Actually the issue seems to be two sessions run by different users on the same box.

@ak-1
Copy link
Contributor Author

ak-1 commented Jul 20, 2022

Before removing a namespace we could check if there are still any processes running in it.
For example with ip netns pids <namespace>. Would that be acceptable?

@jamesmcm
Copy link
Owner

Was this caused by the names previously being truncated at the start, which you fixed in #177 ?

@jamesmcm
Copy link
Owner

@ak-1 yeah I think that should work, in the end I'd like to avoid shelling out but it'll do for now.

@ak-1
Copy link
Contributor Author

ak-1 commented Jul 20, 2022

@jamesmcm About the relationship to #177: Good question, but I think this is unrelated.
If I understand the code correctly vopono currently only tracks other vopono executions by the same user and in my case there was another session by a different user whose namespace got removed.

@jamesmcm jamesmcm mentioned this issue Jul 24, 2022
@jamesmcm
Copy link
Owner

Somewhat fixed in 0.10.1 - now the cleaning of dead namespaces will leave those which have PIDs running - but this doesn't apply for the cleaning of the created network namespace when vopono is closed.

So this could still be an issue if you run two separate vopono instances on different users, to the same network namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working important An important issue that should be resolved quickly
Projects
None yet
Development

No branches or pull requests

2 participants