Skip to content

Close resource profiler process on __exit__#2871

Merged
jcrist merged 1 commit intodask:masterfrom
jcrist:close-resoureprofiler-on-exit
Nov 8, 2017
Merged

Close resource profiler process on __exit__#2871
jcrist merged 1 commit intodask:masterfrom
jcrist:close-resoureprofiler-on-exit

Conversation

@jcrist
Copy link
Copy Markdown
Member

@jcrist jcrist commented Nov 8, 2017

Previously ResourceProfiler would start a tracker process on
__init__, which would then persist until .close() was called (or the
profiler was garbage collected). This led to processes unintentionally
persisting longer than intended by users.

Now we close the tracker process on context exit, and restart it if it's
closed on enter. When registered globally (not in a context manager) the
process persists until close is explictly called, as it was before.

All user code should continue to work the same, and the cost of
restarting the process should be minimal compared to the cost of the
computations being profiled.

Fixes #2869.

Previously ``ResourceProfiler`` would start a tracker process on
`__init__`, which would then persist until `.close()` was called (or the
profiler was garbage collected). This led to processes unintentionally
persisting longer than intended by users.

Now we close the tracker process on context exit, and restart it if it's
closed on enter. When registered globally (not in a context manager) the
process persists until `close` is explictly called, as it was before.
All user code should continue to work the same, and the cost of
restarting the process should be minimal compared to the cost of the
computations being profiled.
@jcrist
Copy link
Copy Markdown
Member Author

jcrist commented Nov 8, 2017

Ping @pitrou for review.

Copy link
Copy Markdown
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jcrist jcrist merged commit 5c5d759 into dask:master Nov 8, 2017
@jcrist jcrist deleted the close-resoureprofiler-on-exit branch November 8, 2017 20:19
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.

ResourceProfiler keeps running after __exit__

2 participants