nslookup失败后,Celery Beat进程崩溃

时间:2016-07-18 19:18:25

标签: python celery celerybeat

我正在使用Celery 3.1.19进行计划任务。我这样开始这个过程:

celery beat --app=my_app.celery.app:app --pidfile=/usr/local/celerybeat.pid --schedule=/usr/local/celerybeat-schedule -l INFO

在nslookup失败后,我发生了几次芹菜进程终止的事件。这会导致将来的计划任务无法运行。最后我注意到并重新开始芹菜节拍。

据我所知,它试图查找的主机名是我的RabbitMQ主机。 nslookup失败是暂时的。主机名是正确的,显然名称解析有一个小问题。理想情况下,这不会导致进程崩溃,而是在主机名查找成功之前重试。

问题:

  1. 这是预期的行为吗?
  2. 是否有一种通用方法可以确保调度程序继续运行?
  3. 人们是否有系统来监视进程并在崩溃时重新启动?
  4. 堆栈追踪:

     Message Error: Couldn't apply scheduled task ping: Error opening socket: hostname lookup failed
     File "/usr/local/bin/celery", line 11, in <module>
     sys.exit(main())
     File "/usr/local/lib/python2.7/dist-packages/celery/__main__.py", line 30, in main
     main()
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 81, in main
     cmd.execute_from_commandline(argv)
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 770, in execute_from_commandline
     super(CeleryCommand, self).execute_from_commandline(argv)))
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 311, in execute_from_commandline
     return self.handle_argv(self.prog_name, argv[1:])
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 762, in handle_argv
     return self.execute(command, argv)
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 694, in execute
     ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 315, in run_from_argv
     sys.argv if argv is None else argv, command)
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 377, in handle_argv
     return self(*args, **options)
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 274, in __call__
     ret = self.run(*args, **kwargs)
     File "/usr/local/lib/python2.7/dist-packages/celery/bin/beat.py", line 79, in run
     return beat().run()
     File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 83, in run
     self.start_scheduler()
     File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 112, in start_scheduler
     beat.start()
     File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 473, in start
     File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 221, in tick
    

0 个答案:

没有答案