Skip to content

Commit 670fbfb

Browse files
Log traceback upon task error (#8746)
1 parent 9d36228 commit 670fbfb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

distributed/tests/test_worker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ async def test_log_exception_on_failed_task(c, s, a, b):
878878
text = logger.getvalue()
879879
assert "ZeroDivisionError" in text
880880
assert "Exception" in text
881+
assert "Traceback" in text
881882

882883

883884
@gen_cluster(client=True)

distributed/worker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2348,13 +2348,15 @@ async def execute(self, key: Key, *, stimulus_id: str) -> StateMachineEvent:
23482348
"Function: %s\n"
23492349
"args: %s\n"
23502350
"kwargs: %s\n"
2351-
"Exception: %r\n",
2351+
"Exception: %r\n"
2352+
"Traceback: %r\n",
23522353
key,
23532354
ts.state,
23542355
str(funcname(function))[:1000],
23552356
convert_args_to_str(args2, max_len=1000),
23562357
convert_kwargs_to_str(kwargs2, max_len=1000),
23572358
result["exception_text"],
2359+
result["traceback_text"],
23582360
)
23592361

23602362
return ExecuteFailureEvent.from_exception(

0 commit comments

Comments
 (0)