Skip to content

Commit

Permalink
Log exception in local executor
Browse files Browse the repository at this point in the history
The log.error() call swallows the traceback, making debugging much
difficult. This makes the full traceback be logged instead.
  • Loading branch information
uranusjr committed Feb 18, 2022
1 parent 9ad4de8 commit 693fecb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions airflow/executors/local_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def _execute_work_in_fork(self, command: CommandType) -> str:
ret = 0
return State.SUCCESS
except Exception as e:
self.log.error("Failed to execute task %s.", str(e))
self.log.exception("Failed to execute task %s.", e)
return State.FAILED
finally:
Sentry.flush()
logging.shutdown()
os._exit(ret)
raise RuntimeError('unreachable -- keep mypy happy')

@abstractmethod
def do_work(self):
Expand Down

0 comments on commit 693fecb

Please sign in to comment.