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

[Python] Ensure producer is keeping the client object alive #11887

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Sep 1, 2021

Motivation

Fix #6463.

When a producer is created, keep a reference on the client object so that the Python GC will not destroy it. This is similar to what we were already doing for consumer and reader, were we had examples with listeners that need to keep the client/consumer alive.

@merlimat merlimat added this to the 2.9.0 milestone Sep 1, 2021
@merlimat merlimat self-assigned this Sep 1, 2021
@merlimat merlimat added doc-not-needed Your PR changes do not impact docs type/bug The PR fixed a bug or issue reported a bug labels Sep 1, 2021
@BewareMyPower BewareMyPower merged commit 235e678 into apache:master Sep 2, 2021
hangc0276 pushed a commit that referenced this pull request Sep 4, 2021
### Motivation

Fix #6463.

When a producer is created, keep a reference on the client object so that the Python GC will not destroy it. This is similar to what we were already doing for consumer and reader, were we had examples with listeners that need to keep the client/consumer alive.

(cherry picked from commit 235e678)
@hangc0276 hangc0276 added cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.1 and removed release/2.8.2 labels Sep 4, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…1887)

### Motivation

Fix apache#6463. 

When a producer is created, keep a reference on the client object so that the Python GC will not destroy it. This is similar to what we were already doing for consumer and reader, were we had examples with listeners that need to keep the client/consumer alive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.1 release/2.9.0 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pulsar-client 2.5 - Segmentation fault: 11 on Mac OS 10.14.6 using Python 3.7.6
5 participants