Skip to content

Commit

Permalink
Fix issue with config-nodemgr and cassandra-repair listening on same …
Browse files Browse the repository at this point in the history
…port

contrail-config-nodemgr spawns contrail-cassandra-repair using
subprocess.Popen and thus contrail-cassandra-repair inherits all
the fds including the listening fd. Then when contrail-config-nodemgr
is restarted/killed, contrail-cassandra-repair will still have the
listening fd and hence contrail-config-nodemgr will not be able to
come up and listen on the same port. Fix is to use - close_fds=True
in the Popen call since the parent and child don't really need to
communicate or share anything using fds and this will close all the
fds shared from parent in the child.

Change-Id: Icef9f981c6447dd013cebeab727f49c5e2cf74f8
Closes-Bug: #1643466
(cherry picked from commit 2d104f0)
  • Loading branch information
Megh Bhatt authored and Raj Reddy committed Jan 9, 2017
1 parent 4cd71c7 commit 1a103fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nodemgr/database_nodemgr/common.py
Expand Up @@ -12,10 +12,10 @@ def __init__(self, cassandra_repair_logdir):
def status(self):
subprocess.Popen(["contrail-cassandra-status",
"--log-file", "/var/log/cassandra/status.log",
"--debug"])
"--debug"], close_fds=True)

def repair(self):
logdir = self.cassandra_repair_logdir + "repair.log"
subprocess.Popen(["contrail-cassandra-repair",
"--log-file", logdir,
"--debug"])
"--debug"], close_fds=True)

0 comments on commit 1a103fe

Please sign in to comment.