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

Cleanup tasks in memory #543

Merged
merged 1 commit into from
Apr 14, 2023
Merged

Cleanup tasks in memory #543

merged 1 commit into from
Apr 14, 2023

Conversation

gabegma
Copy link
Contributor

@gabegma gabegma commented Apr 12, 2023

Description:

  • Some tasks would be kept in memory forever. This PR makes sure to delete all futures that might be lingering.

Checklist:

You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.

  • ISSUE NUMBER. You linked the issue number (Ex: Resolve #XXX).
  • PRE-COMMIT. You ran pre-commit on all commits, or else, you
    ran pre-commit run --all-files at the end.
  • USER CHANGES. The changes are added to CHANGELOG.md and the documentation, if they impact
    our users.
  • DEV CHANGES.
    • Update the documentation if this PR changes how to develop/launch on the app.
    • Update the README files and our wiki for any big design decisions, if relevant.
    • Add unit tests, docstrings, typing and comments for complex sections.

@gabegma gabegma self-assigned this Apr 12, 2023
@gabegma gabegma marked this pull request as ready for review April 12, 2023 20:00
@gabegma gabegma closed this Apr 13, 2023
@gabegma gabegma reopened this Apr 13, 2023
Copy link
Contributor

@JosephMarinier JosephMarinier left a comment

Choose a reason for hiding this comment

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

I have one question/comment, and even if we decide to make a change, it could totally be in a later PR, since that LGTM as is.

@@ -217,6 +217,10 @@ def on_end(self, fut, module):
self._store_data_in_cache(fut.result(), fut.indices)
log.info(f"{self.name} completed and stored in cache", status=fut.status)

def delete_future(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

The only question I have is whether the caller (from outside dask_module.py) needs to know HOW this works (setting future to None), or if it would be more user-friendly to simply say WHAT it does (not mentioning that it involves some future poutine), for example

Suggested change
def delete_future(self):
def clear(self):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would be ok with it! I'll make the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool! THat way, we keep the implementation for, well, the implementation. 👍

@gabegma gabegma merged commit fb76aa5 into main Apr 14, 2023
@gabegma gabegma deleted the ggm/clean-task-in-memory branch April 14, 2023 00:30
gabegma added a commit that referenced this pull request Apr 19, 2023
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.

2 participants