-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,7 @@ def run(self): | |
random.seed((os.getpid(), time.time())) | ||
|
||
status = FAILED | ||
error_message = '' | ||
expl = '' | ||
missing = [] | ||
new_deps = [] | ||
try: | ||
|
@@ -146,7 +146,7 @@ def run(self): | |
elif status == DONE: | ||
self.task.trigger_event( | ||
Event.PROCESSING_TIME, self.task, time.time() - t0) | ||
error_message = json.dumps(self.task.on_success()) | ||
expl = json.dumps(self.task.on_success()) | ||
logger.info('[pid %s] Worker %s done %s', os.getpid(), | ||
self.worker_id, self.task.task_id) | ||
self.task.trigger_event(Event.SUCCESS, self.task) | ||
|
@@ -159,13 +159,15 @@ def run(self): | |
self.task.trigger_event(Event.FAILURE, self.task, ex) | ||
subject = "Luigi: %s FAILED" % self.task | ||
|
||
error_message = notifications.wrap_traceback(self.task.on_failure(ex)) | ||
raw_error_message = self.task.on_failure(ex) | ||
notification_error_message = notifications.wrap_traceback(raw_error_message) | ||
expl = json.dumps(raw_error_message) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dhruvg
Author
Contributor
|
||
formatted_error_message = notifications.format_task_error(subject, self.task, | ||
formatted_exception=error_message) | ||
formatted_exception=notification_error_message) | ||
notifications.send_error_email(subject, formatted_error_message, self.task.owner_email) | ||
finally: | ||
self.result_queue.put( | ||
(self.task.task_id, status, error_message, missing, new_deps)) | ||
(self.task.task_id, status, expl, missing, new_deps)) | ||
|
||
|
||
class SingleProcessPool(object): | ||
|
@@ -635,7 +637,7 @@ def _handle_next_task(self): | |
self._purge_children() # Deal with subprocess failures | ||
|
||
try: | ||
task_id, status, error_message, missing, new_requirements = ( | ||
task_id, status, expl, missing, new_requirements = ( | ||
self._task_result_queue.get( | ||
timeout=float(self._config.wait_interval))) | ||
except Queue.Empty: | ||
|
@@ -657,7 +659,7 @@ def _handle_next_task(self): | |
self._add_task(worker=self._id, | ||
task_id=task_id, | ||
status=status, | ||
expl=error_message, | ||
expl=expl, | ||
resources=task.process_resources(), | ||
runnable=None, | ||
params=task.to_str_params(), | ||
|
json(dumps(raw_error_message)
causes new lines in tracebacks to be escaped. Is there a reason why we calljson.dumps()
here? I believeraw_error_message
is a string. See PR #1086.