diff --git a/IPython/parallel/apps/baseapp.py b/IPython/parallel/apps/baseapp.py index 614fa7f..203b9af 100755 --- a/IPython/parallel/apps/baseapp.py +++ b/IPython/parallel/apps/baseapp.py @@ -162,6 +162,10 @@ class BaseParallelApplication(BaseIPythonApplication): self._log_formatter = logging.Formatter("[%(name)s] %(message)s") self._log_handler.setFormatter(self._log_formatter) self.log.addHandler(self._log_handler) + # do not propagate log messages to root logger + # ipcluster app will sometimes print duplicate messages during shutdown + # if this is 1 (default): + self.log.propagate = False def write_pid_file(self, overwrite=False): """Create a .pid file in the pid_dir with my pid. diff --git a/IPython/parallel/util.py b/IPython/parallel/util.py index fb83640..b9a5153 100644 --- a/IPython/parallel/util.py +++ b/IPython/parallel/util.py @@ -40,6 +40,7 @@ import zmq from zmq.log import handlers # IPython imports +from IPython.config.application import Application from IPython.utils.pickleutil import can, uncan, canSequence, uncanSequence from IPython.utils.newserialized import serialize, unserialize from IPython.zmq.log import EnginePUBHandler @@ -391,7 +392,8 @@ def select_random_ports(n): def signal_children(children): """Relay interupt/term signals to children, for more solid process cleanup.""" def terminate_children(sig, frame): - logging.critical("Got signal %i, terminating children..."%sig) + log = Application.instance().log + log.critical("Got signal %i, terminating children..."%sig) for child in children: child.terminate()