Comment 6 for bug 1436414

Revision history for this message
Ilya Shakhat (shakhat) wrote :

q-agent-cleanup uses the following code to call processes:
 process = subprocess.Popen(
cmd,
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
rc = process.wait()
(https://github.com/stackforge/fuel-library/blob/master/deployment/puppet/cluster/files/q-agent-cleanup.py#L267)

According to documentation (https://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait):
Popen.wait()
    Wait for child process to terminate. Set and return returncode attribute.

    Warning! This will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.

From strace output (https://bugs.launchpad.net/fuel/+bug/1436414/comments/5) the buffer size is 4096 bytes. That means that call to wait() will hang if ip netns list outputs more than this. That in turn means that the max number of namespaces (networks) is 4096 / 43 = 95.