apache / apache/pulsar-client-python

Pulsar client with custom logger may not terminate gracefully when a producer is created

Đang mở
#256 4 bình luận 0 reaction 1 người được giao Được @BewareMyPower nhận Xem trên GitHub
Ngôn ngữ chính
Python
Star
75
Fork
53
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When providing a custom logger to the Pulsar client and creating a producer, intermittent terminations occur with the following error:
```bash
terminate called without an active exception
Aborted (core dumped)
```

This doesn't happen consistently; I'd estimate it occurs in about 1 out of 20 runs. The other executions complete gracefully as expected. As the setup here is almost exactly as in https://github.com/apache/pulsar-client-python/issues/194, I've tried adding the del statements suggested there, but that hasn't resolved the issue for me.

Here is the Python script I'm using:
```python
import logging
import pulsar

def open_and_close():
pulsar_logger = logging.getLogger("pulsarDummyLogger")
client = pulsar.Client("pulsar://localhost:6650", logger=pulsar_logger)
producer = client.create_producer("A")
producer.close()
client.close()
del producer
del client

if __name__ == "__main__":
open_and_close()
```
I'm running it using the following bash command (as it doesn't happen all the time, I must run it a few times to encounter it):
```bash
for i in {1..20}; do env/bin/python python_script.py || break; done
```

I tried it on python 3.11.3 and on 3.13.3, as well as with pulsar-client 3.5.0, 3.6.0, 3.6.1, 3.7.0.

Any insights or suggestions would be greatly appreciated

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.