You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/07 16:55:41 UTC
[GitHub] [pulsar] zbentley opened a new pull request #14585: Issue 14583: [python client]: Improve garbage collection of producer/consumer/reader objects
zbentley opened a new pull request #14585:
URL: https://github.com/apache/pulsar/pull/14585
Fixes https://github.com/apache/pulsar/issues/14583
### Motivation
The Python client bindings make it very easy to leak Pulsar client objects. Those leaks manifest in segfaults and program crashes (e.g. https://github.com/apache/pulsar/issues/14582).
### Modifications
Adds an abstract superclass of all stateful python client objects (clients, consumers, readers, producers) which coordinates garbage collection of those objects, according to these principles:
- Disposing of an object should close its underlying resources.
- If the only reference a program holds is to a "child" object (one descended from a client) and that child is disposed of, the parent client that created it should also then be disconnected and destroyed.
### Verifying this change
This change added tests and can be verified as follows:
- Added a test case to `test_pulsar` which ensures that no file handles are leaked after consumer objects are destroyed. This test runs under an artificially lowered file handle limit; if handles are leaked, errors will be raised (well, segfaults and sigaborts are raised right now, but errors will be raised after #14582 is fixed).
### Documentation
I do not believe that this PR affects external API contracts or behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] BewareMyPower commented on pull request #14585: Issue 14583: [python client]: Improve garbage collection of producer/consumer/reader objects
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #14585:
URL: https://github.com/apache/pulsar/pull/14585#issuecomment-1061361600
Could you fix the license check?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on pull request #14585: Issue 14583: [python client]: Improve garbage collection of producer/consumer/reader objects
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14585:
URL: https://github.com/apache/pulsar/pull/14585#issuecomment-1060906346
@zbentley:Thanks for your contribution. For this PR, do we need to update docs?
(The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on pull request #14585: Issue 14583: [python client]: Improve garbage collection of producer/consumer/reader objects
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14585:
URL: https://github.com/apache/pulsar/pull/14585#issuecomment-1060908689
@zbentley:Thanks for providing doc info!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org