Changeset 4ea1e22 for fedd/federation


Ignore:
Timestamp:
Jul 27, 2009 7:56:29 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
d5e3b8e
Parents:
fc36019
Message:

make sure that subprocesses aren\'t holding the server sockets open.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    rfc36019 r4ea1e22  
    538538            self.log.debug("[scp_file]: %s" % " ".join(scp_cmd))
    539539            if not self.debug:
    540                 rv = call(scp_cmd, stdout=dnull, stderr=dnull)
     540                rv = call(scp_cmd, stdout=dnull, stderr=dnull, close_fds=True,
     541                        close_fds=True)
    541542
    542543            return rv == 0
     
    563564            if not self.debug:
    564565                if dnull:
    565                     sub = Popen(sh_str, shell=True, stdout=dnull, stderr=dnull)
     566                    sub = Popen(sh_str, shell=True, stdout=dnull, stderr=dnull,
     567                            close_fds=True)
    566568                else:
    567                     sub = Popen(sh_str, shell=True)
     569                    sub = Popen(sh_str, shell=True,
     570                            close_fds=True)
    568571                if timeout:
    569572                    i = 0
     
    648651                rv = 0
    649652            else:
    650                 status = Popen(cmd, stdout=PIPE, stderr=dev_null)
     653                status = Popen(cmd, stdout=PIPE, stderr=dev_null,
     654                        close_fds=True)
    651655                for line in status.stdout:
    652656                    m = state_re.match(line)
     
    855859        # May raise CalledProcessError
    856860        self.log.debug("[generate_ssh_keys]: %s" % " ".join(cmd))
    857         rv = call(cmd, stdout=trace, stderr=trace)
     861        rv = call(cmd, stdout=trace, stderr=trace, close_fds=True)
    858862        if rv != 0:
    859863            raise service_error(service_error.internal,
     
    9991003        # Use dot to create a visualization
    10001004        dot = Popen([neato, '-Gstart=rand', '-Gepsilon=0.005', '-Gmaxiter=2000',
    1001                 '-Gpack=true', dotname], stdout=PIPE)
     1005                '-Gpack=true', dotname], stdout=PIPE, close_fds=True)
    10021006
    10031007        # Translate dot to vis format
     
    18951899
    18961900                self.log.debug("running local splitter %s", " ".join(tclcmd))
    1897                 tclparser = Popen(tclcmd, stdout=PIPE)
     1901                tclparser = Popen(tclcmd, stdout=PIPE, close_fds=True)
    18981902                split_data = tclparser.stdout
    18991903
Note: See TracChangeset for help on using the changeset viewer.