-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Handle CancelledError
properly in ConnectionPool
#8110
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3326,52 +3326,13 @@ async def test_gather_dep_no_longer_in_flight_tasks(c, s, a): | |
assert not any("missing-dep" in msg for msg in f2_story) | ||
|
||
|
||
@gen_cluster(client=True, nthreads=[("", 1)]) | ||
async def test_gather_dep_cancelled_error(c, s, a): | ||
"""Something somewhere in the networking stack raises CancelledError while | ||
gather_dep is running | ||
|
||
See Also | ||
-------- | ||
test_get_data_cancelled_error | ||
https://github.com/dask/distributed/issues/8006 | ||
""" | ||
async with BlockedGetData(s.address) as b: | ||
x = c.submit(inc, 1, key="x", workers=[b.address]) | ||
y = c.submit(inc, x, key="y", workers=[a.address]) | ||
await b.in_get_data.wait() | ||
tasks = { | ||
task for task in asyncio.all_tasks() if "gather_dep" in task.get_name() | ||
} | ||
assert tasks | ||
# There should be only one task but cope with finding more just in case a | ||
# previous test didn't properly clean up | ||
for task in tasks: | ||
task.cancel() | ||
|
||
b.block_get_data.set() | ||
assert await y == 3 | ||
|
||
assert_story( | ||
a.state.story("x"), | ||
[ | ||
("x", "fetch", "flight", "flight", {}), | ||
("x", "flight", "missing", "missing", {}), | ||
("x", "missing", "fetch", "fetch", {}), | ||
("x", "fetch", "flight", "flight", {}), | ||
("x", "flight", "memory", "memory", {"y": "ready"}), | ||
], | ||
) | ||
Comment on lines
-3329
to
-3364
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is too artificial. It trigger a condition that is only possible during worker shutdown. Nothing is ever cancelling the actual There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other PR is introducing also The test is provoking a (still wrong and artifical) |
||
|
||
|
||
@gen_cluster(client=True, nthreads=[("", 1)], timeout=5) | ||
async def test_get_data_cancelled_error(c, s, a): | ||
"""Something somewhere in the networking stack raises CancelledError while | ||
get_data is running | ||
|
||
See Also | ||
-------- | ||
test_gather_dep_cancelled_error | ||
https://github.com/dask/distributed/issues/8006 | ||
""" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@graingert I'm all ears if you know how to better test this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got
test_remove_cancels_connect_before_task_running
which appears to produce this condition 🎉 (not a perfect test but it's something)