From: Ondrej Lichtner olichtne@redhat.com
When the lnst-slave process forks, the parent process should wait for the result returned by rest of the add_namespace method. Otherwise 2 result messages are created, which could cause the Ctl <-> Slave message lock-step to be desynchronized and cause race condition issues.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Slave/NetTestSlave.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 8e26b4b..f11ca8b 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -670,7 +670,8 @@ class SlaveMethods: self._net_namespaces[netns] = {"pid": pid, "pipe": read_pipe} self._server_handler.add_netns(netns, read_pipe) - return False + result = self._slave_server.wait_for_result(netns) + return result["result"] elif pid == 0: self._slave_server.set_netns_sighandlers() #create new network namespace
Fri, Jan 20, 2017 at 03:16:19PM CET, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
When the lnst-slave process forks, the parent process should wait for the result returned by rest of the add_namespace method. Otherwise 2 result messages are created, which could cause the Ctl <-> Slave message lock-step to be desynchronized and cause race condition issues.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
lnst/Slave/NetTestSlave.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 8e26b4b..f11ca8b 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -670,7 +670,8 @@ class SlaveMethods: self._net_namespaces[netns] = {"pid": pid, "pipe": read_pipe} self._server_handler.add_netns(netns, read_pipe)
return False
result = self._slave_server.wait_for_result(netns)
return result["result"] elif pid == 0: self._slave_server.set_netns_sighandlers() #create new network namespace
-- 2.11.0 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org
I tested this patch and it fixes the issue I'm having.
Acked-by: Jan Tluka jtluka@redhat.com
Fri, Jan 20, 2017 at 03:16:19PM CET, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
When the lnst-slave process forks, the parent process should wait for the result returned by rest of the add_namespace method. Otherwise 2 result messages are created, which could cause the Ctl <-> Slave message lock-step to be desynchronized and cause race condition issues.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
Pushed, thanks!
-Jan
lnst-developers@lists.fedorahosted.org