Skip to content

Handle dask exceptions at the futures layer #17725

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

Closed
wants to merge 1 commit into from
Closed

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Apr 4, 2025

This PR handles some "expected" exceptions that dask might raise when waiting on future resolution. This addresses #17384 but only partially: the flow run is correctly marked as Crashed with all exceptions handled gracefully, but the task run remains in a Running state indefinitely. I think we need server side handling of crashes to correctly mark all still Running tasks appropriately, but that's for another day.

Closes #17384

Comment on lines +126 to +131
# handle dask specific exceptions that indicate a problem with this task
self._final_state = State(
type="CRASHED",
data=exc,
message=f"Encountered an unexpected exception from dask: {exc!r}",
)
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we could update the task state here so that the task shows as CRASHED in the UI?

Copy link
Member Author

Choose a reason for hiding this comment

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

What's the best way to do that -- emit_event?

Copy link
Member

Choose a reason for hiding this comment

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

I think prefect.utilities.engine.emit_task_state_change_event is the easiest way to do that.

Copy link
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Copy link
Contributor

github-actions bot commented May 3, 2025

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Copy link
Contributor

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

@github-actions github-actions bot closed this May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DaskTaskRunner does not handle Dask exceptions
2 participants