dask / dask/distributed

"Task was destroyed but it is pending"

Open
#3,940 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

From #3912:

When only running a single test, I get these messages after the pytest run completes:

```
Task was destroyed but it is pending!
task: wait_for=()]> cb=[IOLoop.add_future..() at /home/alex/.virtualenvs/distributed/lib/python3.8/site-packages/tornado/ioloop.py:690]>
Task was destroyed but it is pending!
task: wait_for=()]> cb=[_release_waiter(()]>)() at /usr/lib/python3.8/asyncio/tasks.py:429]>
```

The following reliably reproduces the issue:

```
$ pytest distributed/tests/test_nanny.py::test_worker_start_exception
```

Running more than this single test silences the error, so I think some cleanup code doesn't get a chance to run or isn't waited for in the `cleanup` fixture.

Thanks!

**Environment**:

- Dask version: 955b5683
- Python version: 3.8.3
- Operating System: Linux
- Install method (conda, pip, source): source

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.