~doanac/lava-celery/logging-madness

Viewing all changes in revision 19.

  • Committer: Andy Doan
  • Date: 2012-06-27 03:40:12 UTC
  • Revision ID: andy.doan@linaro.org-20120627034012-awdi1gfa4kn9hrjf
fix oddness with logging in tasks

The run_remote command wasn't handling all exceptions which under
certain circumstances made celeryd handle the exception. This is
somewhat okay, but the error gets logged in the worker. When you
think about the scenario where we run the dispatcher on a remote
system, the caller (scheduler in this case) will need to see these
types of errors.

The other issue I hit was that when exceptions come from the
CloudifierDispatcher code, the stdout/stderr references get all
munged up in celery's twisted maze of redirecting its stdout to
its loggers. The only simple way out I found was with the hack:

 sys.stderr.logger.root.handlers[0].stream = logging.sys.__stderr__


This also adds a bit of debbuging to indicate when a command is
received, what arguments were passed, and when it finished

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: