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

Purge old Dask futures when no longer needed #13536

Open
3 tasks done
RobJBarr opened this issue May 23, 2024 · 1 comment
Open
3 tasks done

Purge old Dask futures when no longer needed #13536

RobJBarr opened this issue May 23, 2024 · 1 comment
Labels
enhancement An improvement of an existing feature

Comments

@RobJBarr
Copy link

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar request and didn't find it.
  • I searched the Prefect documentation for this feature.

Prefect Version

2.x

Describe the current behavior

In the current implementation of the DaskTaskRunner, the Dask futures for each task are maintained in a dictionary, even when no longer needed in downstream tasks. This results in a reference to the future being maintained on the client side so it is never cleaned up from the workers

Describe the proposed behavior

An option to purge Dask futures which are no longer needed is provided in the DaskTaskRunner. Perhaps this could take the form of a callback once a prefect future is completed to check if all its upstream tasks have any further downstream dependents, and if not then delete the futures so they can be garbage collected

Example Use

No response

Additional context

No response

@RobJBarr RobJBarr added enhancement An improvement of an existing feature needs:triage labels May 23, 2024
@desertaxle
Copy link
Member

Thanks for the issue @RobJBarr! We have a new implementation of the DaskTaskRunner that will released alongside our upcoming 3.0 release that no longer keeps references to Dask futures. I think that will resolve this issue that you're seeing. If you want to give it a try, you can install prefect==3.0.0rc1 and prefect-dask==0.3.0rc1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants