Hi, Yunze

It raises an exception when I run the consumer example.

Here are my environments:
* macos 12.06 x86_64
* python 3.7

Here are my reproduce steps:
* Start the pulsar standalone
* Start the consumer example
* Start the producer example
* The consumer can receive messages successfully.
* Stop the consumer, then it throws some exception:
```
➜  examples git:(main) ✗ python consumer.py
2023-02-28 17:11:04.742 INFO  [0x113b19600] Client:87 | Subscribing on
Topic :my-topic
2023-02-28 17:11:04.742 INFO  [0x113b19600] ClientConnection:190 |
[<none> -> pulsar://localhost:6650] Create ClientConnection,
timeout=10000
2023-02-28 17:11:04.742 INFO  [0x113b19600] ConnectionPool:97 |
Created connection for pulsar://localhost:6650
2023-02-28 17:11:04.745 INFO  [0x700003606000] ClientConnection:388 |
[127.0.0.1:49258 -> 127.0.0.1:6650] Connected to broker
2023-02-28 17:11:04.857 INFO  [0x700003606000] HandlerBase:72 |
[persistent://public/default/my-topic, my-subscription, 0] Getting
connection from pool
2023-02-28 17:11:04.874 INFO  [0x700003606000] ConsumerImpl:238 |
[persistent://public/default/my-topic, my-subscription, 0] Created
consumer on broker [127.0.0.1:49258 -> 127.0.0.1:6650]
Received message 'hello' id='(132,30,-1,0)'
Received message 'hello' id='(132,31,-1,0)'
Received message 'hello' id='(132,32,-1,0)'
Received message 'hello' id='(132,33,-1,0)'
Received message 'hello' id='(132,34,-1,0)'
Received message 'hello' id='(132,35,-1,0)'
Received message 'hello' id='(132,36,-1,0)'
Received message 'hello' id='(132,37,-1,0)'
Received message 'hello' id='(132,38,-1,0)'
Received message 'hello' id='(132,39,-1,0)'
^CKeyboardInterrupt

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "consumer.py", line 32, in <module>
    msg = consumer.receive()
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsar/__init__.py",
line 1243, in receive
    msg = self._consumer.receive()
SystemError
2023-02-28 17:11:07.367 WARN  [0x113b19600] ConsumerImpl:126 |
[persistent://public/default/my-topic, my-subscription, 0] Destroyed
consumer which was not properly closed
2023-02-28 17:11:07.367 INFO  [0x113b19600] ConsumerImpl:134 |
[persistent://public/default/my-topic, my-subscription, 0] Closed
consumer for race condition: 0
libc++abi: terminating with uncaught exception of type
std::__1::bad_weak_ptr: bad_weak_ptr
[1]    56483 abort      python consumer.py
```
This causes the program to crash.

I'm using the example codes here:
https://github.com/apache/pulsar-client-python/tree/main/examples

Could you take a look? Thanks.

BR,
Zike Yang

On Tue, Feb 28, 2023 at 10:37 AM PengHui Li <peng...@apache.org> wrote:
>
> +1 (binding)
>
> - install on macos
> - start a standalone (latest master)
> - run the example
> https://github.com/apache/pulsar-client-python#running-examples
>
> Regards,
> Penghui
>
> On Thu, Feb 23, 2023 at 11:00 PM Enrico Olivelli <eolive...@gmail.com>
> wrote:
>
> > Thank you Yunze for double checking.
> >
> > I don't have time to test the release, so I am voting +0 (and not -1)
> >
> > Enrico
> >
> > Il giorno gio 23 feb 2023 alle ore 12:57 Yunze Xu
> > <y...@streamnative.io.invalid> ha scritto:
> > >
> > > Hi Enrico,
> > >
> > > I will test more operation systems and open a discussion soon. For
> > > now, I just tested the TLS encryption and token authentication, and I
> > > found this issue does not exist as expected for both Python and
> > > Node.js clients.
> > > - Windows: Only Python client works
> > > - Ubuntu: Both work
> > > - macOS: Not tested yet
> > >
> > > But the OAuth2 authentication case doesn't work. It's caused by
> > > https://github.com/apache/pulsar/pull/16064 and fixed by
> > > https://github.com/apache/pulsar-client-cpp/pull/190.
> > >
> > > When the protocol of the issuer URL is HTTPS:
> > > - Before #16064, OAuth2 authentication works by skipping verifying the
> > > peer, it's dangerous for security reasons
> > > - After #16064 and before #190, there is no way to perform OAuth2
> > authentication
> > > - After #190, users can configure the `tls_trust_certs_file_path` to do
> > that.
> > >
> > > So I think it should not be treated as a regression and should not
> > > block this release. We can support automatically detecting the CA
> > > certs for OAuth2 authentication later.
> > >
> > > The regression should be the case when the TLS encryption is enabled.
> > > And as I've said at the beginning, I'm going to do more tests and open
> > > a discussion.
> > >
> > > Thanks,
> > > Yunze
> > >
> > > On Thu, Feb 23, 2023 at 6:06 PM Enrico Olivelli <eolive...@gmail.com>
> > wrote:
> > > >
> > > > Does this version have the same problems about TLS CA Certs as the
> > > > NodeJS client ?
> > > > In that case I would cast a -1
> > > >
> > > > Enrico
> > > >
> > > > Il giorno gio 23 feb 2023 alle ore 01:21 Matteo Merli
> > > > <matteo.me...@gmail.com> ha scritto:
> > > > >
> > > > > +1 bindind
> > > > > --
> > > > > Matteo Merli
> > > > > <matteo.me...@gmail.com>
> > > > >
> > > > >
> > > > > On Fri, Feb 17, 2023 at 3:27 AM Yunze Xu
> > <y...@streamnative.io.invalid>
> > > > > wrote:
> > > > >
> > > > > > This is the 3rd release candidate for Apache Pulsar Client Python,
> > > > > > version 3.1.0.
> > > > > >
> > > > > > It fixes the following issues:
> > > > > >
> > https://github.com/apache/pulsar-client-python/milestone/2?closed=1
> > > > > >
> > > > > > *** Please download, test and vote on this release. This vote will
> > > > > > stay open for at least 72 hours ***
> > > > > >
> > > > > > Python wheels:
> > > > > >
> > > > > >
> > https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-python-3.1.0-candidate-3/
> > > > > >
> > > > > > The supported python versions are 3.7, 3.8, 3.9, 3.10 and 3.11. The
> > > > > > supported platforms and architectures are:
> > > > > > - Windows x86_64 (windows/)
> > > > > > - glibc-based Linux x86_64 (linux-glibc-x86_64/)
> > > > > > - glibc-based Linux arm64 (linux-glibc-arm64/)
> > > > > > - musl-based Linux x86_64 (linux-musl-x86_64/)
> > > > > > - musl-based Linux arm64 (linux-musl-arm64/)
> > > > > > - macOS universal 2 (macos/)
> > > > > >
> > > > > > You can download the wheel (the `.whl` file) according to your own
> > OS
> > > > > > and Python version
> > > > > > and install the wheel:
> > > > > > - Windows: `py -m pip install *.whl --force-reinstall`
> > > > > > - Linux or macOS: `python3 -m pip install *.whl --force-reinstall`
> > > > > >
> > > > > > The tag to be voted upon: v3.1.0-candidate-3
> > > > > > (9ed92ecee632c42b81a3198b8824d70d080af7f0)
> > > > > >
> > > > > >
> > https://github.com/apache/pulsar-client-python/releases/tag/v3.1.0-candidate-3
> > > > > >
> > > > > > Pulsar's KEYS file containing PGP keys you use to sign the release:
> > > > > > https://dist.apache.org/repos/dist/release/pulsar/KEYS
> > > > > >
> > > > > > Please download the Python wheels and follow the README to test.
> > > > > >
> >

Reply via email to