Skip to content

Improve error on cancelled tasks due to disconnect - #8705

Merged
hendrikmakait merged 11 commits into
dask:mainfrom
hendrikmakait:8690
Jun 24, 2024
Merged

hendrikmakait merged 11 commits into
dask:mainfrom
hendrikmakait:8690

Conversation

@hendrikmakait

Copy link
Copy Markdown
Member

Closes #8690

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

@hendrikmakait
hendrikmakait requested a review from fjetter as a code owner June 19, 2024 13:33
@github-actions

github-actions Bot commented Jun 19, 2024 •

Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    29 files  ±    0      29 suites  ±0   11h 31m 28s ⏱️ + 1h 45m 39s
 4 063 tests  -     3   3 959 ✅ +    8     97 💤  -   9  7 ❌ +2 
55 967 runs  +7 625  53 795 ✅ +7 391  2 163 💤 +248  9 ❌ +3 

For more details on these failures, see this check.

Results for commit 192674b. ± Comparison against base commit 03035da.

This pull request removes 13 and adds 10 tests. Note that renamed tests count towards both.
distributed.protocol.tests.test_arrow
distributed.protocol.tests.test_collection
distributed.protocol.tests.test_highlevelgraph
distributed.protocol.tests.test_numpy
distributed.protocol.tests.test_pandas
distributed.shuffle.tests.test_graph
distributed.shuffle.tests.test_merge
distributed.shuffle.tests.test_merge_column_and_index
distributed.shuffle.tests.test_metrics
distributed.shuffle.tests.test_rechunk
…
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_scheduler
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_scheduler_report_args[False]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_scheduler_report_args[report_args0]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_workers[1]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_workers[False]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_workers[True]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_workers_report_args[False]
distributed.diagnostics.tests.test_memray ‑ test_basic_integration_workers_report_args[report_args0]
distributed.tests.test_client ‑ test_client_disconnect_exception_on_cancelled_futures
distributed.tests.test_client ‑ test_scheduler_restart_exception_on_cancelled_futures

♻️ This comment has been updated with latest results.

Comment thread distributed/client.py Outdated
{fu for fu in fs if fu.status == "pending"},
)
cancelled = [f.key for f in done if f.status == "cancelled"]
cancelled = {f.key: f._state.exception for f in done if f.cancelled()}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might become very large. Ideally, we'd group these by the reason for cancellation.

Comment thread distributed/client.py Outdated
bad = {f for f in futures if f.cancelled()}
if bad:
raise CancelledError(bad)
cancelled = {f.key: f._state.exception for f in futures if f.cancelled()}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might become very large. Ideally, we'd group these by the reason for cancellation.

Comment thread distributed/client.py
if key not in self.futures or self.futures[key].status in failed:
for future in future_set:
key = future.key
if key not in self.futures or future.status in failed:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As opposed to futures_of and wait, we only raise a single exception here. We should probably align this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do this in a follow-up PR, this mixes cancellations with actual errors.

@hendrikmakait
hendrikmakait marked this pull request as draft June 19, 2024 15:53
@hendrikmakait
hendrikmakait marked this pull request as ready for review June 19, 2024 16:55
Comment thread distributed/client.py Resolved
@fjetter

fjetter commented Jun 21, 2024

Copy link
Copy Markdown
Member

test failure in test_scheduler_restart_exception_on_cancelled_futures might be related

@hendrikmakait

Copy link
Copy Markdown
Member Author

test failure in test_scheduler_restart_exception_on_cancelled_futures might be related

Should be fixed, it was one of those tests that worked locally but failed on CI

Comment thread distributed/tests/test_client.py Outdated
Comment on lines +8600 to +8601
# @pytest.mark.slow
@gen_cluster(client=True, Worker=Nanny, timeout=60)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still for debugging?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

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.

Better exception if scheduler disconnects from client

2 participants