Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve catch_unhandled_exceptions #6358

Merged
merged 1 commit into from
May 18, 2022

Conversation

gjoseph92
Copy link
Collaborator

  • Catch multiple exceptions, not just the last one (not sure if this actually happens, but I imagined it could)
  • Retain the full context message, which contains useful information such as the asyncio.Task, etc.
  • Print full tracebacks when possible

Split out from #6329. Before, you'd just see an error like

test_client.UnhandledExceptions: Task was destroyed but it is pending!

which is very hard to track down. Now, you see

----------------------------- Captured stdout call -----------------------------
------ Unhandled exception 1/1: 'Task was destroyed but it is pending!' ------
{'message': 'Task was destroyed but it is pending!', 'task': <Task pending name='background-send-Client' coro=<BatchedSend._background_send() done, defined at /home/runner/work/distributed/distributed/distributed/batched.py:80> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2e00d00280>()]>>}

which is a little bit more useful to track down.

cc @graingert

  • Tests added / passed
  • Passes pre-commit run --all-files

* Catch multiple exceptions, not just the last one (not sure if this actually happens, but I imagined it could)
* Retain the full `context` message, which contains useful information such as the `asyncio.Task`, etc.
* Print full tracebacks when possible
@github-actions
Copy link
Contributor

Unit Test Results

       15 files  ±0         15 suites  ±0   6h 57m 1s ⏱️ - 6m 47s
  2 792 tests ±0    2 712 ✔️  - 2    78 💤 ±0  1 +1  1 🔥 +1 
20 707 runs  +1  19 796 ✔️ ±0  908 💤  - 2  2 +2  1 🔥 +1 

For more details on these failures and errors, see this check.

Results for commit 7ba6e50. ± Comparison against base commit 63cdddd.

@gjoseph92
Copy link
Collaborator Author

Failures are distributed/tests/test_stress.py::test_stress_scatter_death which is known to be flaky #6305

@fjetter fjetter merged commit 32313c0 into dask:main May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants