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

Make sure tensorflow_profiler and process_info_tracker are stopped after benchmark method execution #332

Merged
merged 1 commit into from Mar 8, 2019

Conversation

lindong28
Copy link
Contributor

@lindong28 lindong28 commented Mar 8, 2019

Currently, if benchmark method execution throws exception, the tensorflow_profiler.stop() and process_info_tracker.stop() will not be called. Thus their threads won't be closed and benchmark.py will hang forever.

This patch uses try/finally clause to make sure that tensorflow_profiler.stop() and process_info_tracker.stop() will be called after benchmark method either finishes or throws exception.

Copy link
Member

@tfboyd tfboyd left a comment

Choose a reason for hiding this comment

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

LGTM

@tfboyd tfboyd merged commit 7c4c5b8 into tensorflow:master Mar 8, 2019
@lindong28 lindong28 deleted the close-thread-on-exception branch March 14, 2019 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants