-
Notifications
You must be signed in to change notification settings - Fork 609
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
Fix exit sequence. #5138
Fix exit sequence. #5138
Conversation
… that memory resources are ready when the pipeline is created; Register a python atexit handler that shuts down the pipelines. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [10556356]: BUILD STARTED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [10556871]: BUILD STARTED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [10556906]: BUILD STARTED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
def test_shutdown(): | ||
global p | ||
p = pipeline(device_id=None) | ||
p.build() | ||
p.run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test case fail without the fix? If not, maybe some better test would be suitable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't "fail". The script crashes at exit.
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [10557658]: BUILD STARTED |
CI MESSAGE: [10557763]: BUILD STARTED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [10559980]: BUILD STARTED |
if p is None: | ||
Pipeline._pipes.discard(weak) | ||
continue | ||
p._shutdown() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will that work as well?
if p is None: | |
Pipeline._pipes.discard(weak) | |
continue | |
p._shutdown() | |
if p is not None: | |
p._shutdown() |
CI MESSAGE: [10559980]: BUILD PASSED |
Register a python atexit handler that shuts down the pipelines.
Fix host resource cleanup.
Improve Pipeline shutdown sequence; ensure that memory resources are ready when the pipeline is created
Category:
Bug fix (non-breaking change which fixes an issue)
Description:
The bug: when using PythonFunction operator, the shutdown sequence was somehow broken and the pipeline was still running when the interpreter was already torn down and some libraries were unloaded.
The fix:
Register a python atexit handler that shuts down the pipelines.
Fix host resource cleanup.
Improve Pipeline shutdown sequence; ensure that memory resources are ready when the pipeline is created
Additionally (I don't know how necessary this is, after all) - got rid of static variables when creating host default resource.
Additional information:
Affected modules and functionalities:
Pipeline (C++ and Python)
Default resources.
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-3673