Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ipcluster] termination on os x #515

Closed
satra opened this issue Jun 10, 2011 · 3 comments
Closed

[ipcluster] termination on os x #515

satra opened this issue Jun 10, 2011 · 3 comments
Milestone

Comments

@satra
Copy link
Contributor

satra commented Jun 10, 2011

runs fine and then on exit causes a bug.

(ipxi)[satra@robinhill ~]$ ipcluster start -n 4
[IPClusterApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
[IPClusterApp] Starting ipcluster with [daemon=False]
[IPClusterApp] Creating pid file: /Users/satra/.ipython/cluster_default/pid/ipcluster.pid
[IPClusterApp] Starting LocalControllerLauncher: ['/software/venvs/EPD/7.0/ipxi/bin/python', u'/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/parallel/apps/ipcontrollerapp.py', '--log-to-file', '--log-level', '20', '--cluster-dir', u'/Users/satra/.ipython/cluster_default']
[IPClusterApp] Process '/software/venvs/EPD/7.0/ipxi/bin/python' started: 3360
[IPClusterApp] IPython cluster: started
[IPClusterApp] [IPControllerApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPControllerApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
[IPClusterApp] Process '/software/venvs/EPD/7.0/ipxi/bin/python' started: 3367
[IPClusterApp] Starting LocalEngineSetLauncher: ['/software/venvs/EPD/7.0/ipxi/bin/python', u'/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py', '--log-to-file', '--log-level', '20', '--cluster-dir', u'/Users/satra/.ipython/cluster_default']
[IPClusterApp] Process '/software/venvs/EPD/7.0/ipxi/bin/python' started: 3368
[IPClusterApp] Process '/software/venvs/EPD/7.0/ipxi/bin/python' started: 3369
[IPClusterApp] Process '/software/venvs/EPD/7.0/ipxi/bin/python' started: 3370
[IPClusterApp] Process 'engine set' started: [None, None, None, None]
[IPClusterApp] [IPEngineApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Using existing cluster dir: /Users/satra/.ipython/cluster_default
[IPClusterApp] [IPEngineApp] Cluster directory set to: /Users/satra/.ipython/cluster_default
^C[IPClusterApp] IPython cluster: stopping

[IPClusterApp] Removing pid file: /Users/satra/.ipython/cluster_default/pid/ipcluster.pid

NameError Python 2.7.1: /software/venvs/EPD/7.0/ipxi/bin/python
Fri Jun 10 17:29:11 2011
A problem occured executing Python code. Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/software/venvs/EPD/7.0/ipxi/bin/ipcluster in ()
1 #!/software/venvs/EPD/7.0/ipxi/bin/python
2 # EASY-INSTALL-ENTRY-SCRIPT: 'ipython==0.11.dev','console_scripts','ipcluster'
3 requires = 'ipython==0.11.dev'
4 import sys
5 from pkg_resources import load_entry_point
6
7 sys.exit(
----> 8 load_entry_point('ipython==0.11.dev', 'console_scripts', 'ipcluster')()
global load_entry_point = <function load_entry_point at 0x1004d6050>
9 )

/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/parallel/apps/ipclusterapp.pyc in launch_new_instance()
597 exc_info=True)
598 self.remove_pid_file()
599 elif os.name=='nt':
600 try:
601 # kill the whole tree
602 p = check_call(['taskkill', '-pid', str(pid), '-t', '-f'], stdout=PIPE,stderr=PIPE)
603 except (CalledProcessError, OSError):
604 self.log.error("Stopping cluster failed, assuming already dead.",
605 exc_info=True)
606 self.remove_pid_file()
607
608
609 def launch_new_instance():
610 """Create and run the IPython cluster."""
611 app = IPClusterApp()
--> 612 app.start()
613
614
615 if name == 'main':
616 launch_new_instance()
617

/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/core/application.pyc in start(self=<IPython.parallel.apps.ipclusterapp.IPClusterApp object>)
205 # Merge all config objects into a single one the app can then use
206 self.merge_configs()
207 self.log_master_config()
208
209 # Construction phase
210 self.pre_construct()
211 self.construct()
212 self.post_construct()
213
214 # Done, flag as such and
215 self._initialized = True
216
217 def start(self):
218 """Start the application."""
219 self.initialize()
--> 220 self.start_app()
221
222 #-------------------------------------------------------------------------
223 # Various stages of Application creation
224 #-------------------------------------------------------------------------
225
226 def create_crash_handler(self):
227 """Create a crash handler, typically setting sys.excepthook to it."""
228 self.crash_handler = self.crash_handler_class(self)
229 sys.excepthook = self.crash_handler
230
231 def create_default_config(self):
232 """Create defaults that can't be set elsewhere.
233
234 For the most part, we try to set default in the class attributes
235 of Configurables. But, defaults the top-level Application (which is

/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/parallel/apps/ipclusterapp.pyc in start_app(self=<IPython.parallel.apps.ipclusterapp.IPClusterApp object>)
471 # Remove old log files of the controller and engine
472 if self.master_config.Global.clean_logs:
473 log_dir = self.master_config.Global.log_dir
474 for f in os.listdir(log_dir):
475 if re.match(r'ip(engine|controller)z-\d+.(log|err|out)',f):
476 os.remove(os.path.join(log_dir, f))
477 # This will remove old log files for ipcluster itself
478 super(IPClusterApp, self).start_logging()
479
480 def start_app(self):
481 """Start the application, depending on what subcommand is used."""
482 subcmd = self.master_config.Global.subcommand
483 if subcmd=='create' or subcmd=='list':
484 return
485 elif subcmd=='start':
--> 486 self.start_app_start()
487 elif subcmd=='stop':
488 self.start_app_stop()
489 elif subcmd=='engines':
490 self.start_app_engines()
491
492 def start_app_start(self):
493 """Start the app for the start subcommand."""
494 config = self.master_config
495 # First see if the cluster is already running
496 try:
497 pid = self.get_pid_from_file()
498 except PIDFileError:
499 pass
500 else:
501 if self.check_pid(pid):

/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/IPython/parallel/apps/ipclusterapp.pyc in start_app_start(self=<IPython.parallel.apps.ipclusterapp.IPClusterApp object>)
511
512
513 # Now log and daemonize
514 self.log.info(
515 'Starting ipcluster with [daemon=%r]' % config.Global.daemonize
516 )
517 # TODO: Get daemonize working on Windows or as a Windows Server.
518 if config.Global.daemonize:
519 if os.name=='posix':
520 from twisted.scripts._twistd_unix import daemonize
521 daemonize()
522
523 # Now write the new pid file AFTER our new forked pid is active.
524 self.write_pid_file()
525 try:
--> 526 self.loop.start()
527 except KeyboardInterrupt:
528 pass
529 except zmq.ZMQError as e:
530 if e.errno == errno.EINTR:
531 pass
532 else:
533 raise
534 finally:
535 self.remove_pid_file()
536
537 def start_app_engines(self):
538 """Start the app for the start subcommand."""
539 config = self.master_config
540 # First see if the cluster is already running
541

/software/venvs/EPD/7.0/ipxi/lib/python2.7/site-packages/zmq/eventloop/ioloop.pyc in start(self=<zmq.eventloop.ioloop.IOLoop object>)
244
245 if self._blocking_signal_threshold is not None:
246 # clear alarm so it doesn't fire while poll is waiting for
247 # events.
248 signal.setitimer(signal.ITIMER_REAL, 0, 0)
249
250 try:
251 event_pairs = self._impl.poll(poll_timeout)
252 except ZMQError:
253 e = sys.exc_info()[1]
254 if e.errno == ETERM:
255 # This happens when the zmq Context is closed; we should just exit.
256 self._running = False
257 self._stopped = True
258 break
--> 259 elif e.errno == EINTR:
260 logging.warning("Interrupted system call", exc_info=1)
261 continue
262 else:
263 raise
264 except Exception:
265 e = sys.exc_info()[1]
266 # Depending on python version and IOLoop implementation,
267 # different exception types may be thrown and there are
268 # two ways EINTR might be signaled:
269 # * e.errno == errno.EINTR
270 # * e.args is like (errno.EINTR, 'Interrupted system call')
271 if (getattr(e, 'errno', None) == errno.EINTR or
272 (isinstance(getattr(e, 'args', None), tuple) and
273 len(e.args) == 2 and e.args[0] == errno.EINTR)):
274 logging.warning("Interrupted system call", exc_info=1)

NameError: global name 'EINTR' is not defined


Oops, ipcluster crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:

  • A verbatim copy of the crash traceback.
  • Data on your current ipcluster configuration.

It was left in the file named:
'/Users/satra/.ipython/Crash_report_ipcluster.txt'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: Brian E Granger at ellisonbg@gmail.com
with the subject 'ipcluster Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s 'ipcluster Crash Report' ellisonbg@gmail.com < /Users/satra/.ipython/Crash_report_ipcluster.txt

To ensure accurate tracking of this issue, please file a report about it at:
http://github.com/ipython/ipython/issues

@takluyver
Copy link
Member

Looks like it's a bug in pyzmq.

And that line's already changed in trunk, so it might be fixed if you grab an updated version of pyzmq.

https://github.com/zeromq/pyzmq/blob/master/zmq/eventloop/ioloop.py#L259

@minrk
Copy link
Member

minrk commented Jun 10, 2011

This was a short-lived typo in pyzmq, affects no releases, and is fixed in current master. I'm impressed you managed to download in the affected time.

@satra
Copy link
Contributor Author

satra commented Jun 10, 2011

indeed its fixed! thanks!

On Fri, Jun 10, 2011 at 5:48 PM, minrk <
reply@reply.github.com>wrote:

This was a short-lived typo in pyzmq, affects no releases, and is fixed in
current master. I'm impressed you managed to download in the affected time.

Reply to this email directly or view it on GitHub:
#515 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants