apache / apache/pulsar-client-python

[Bug] Segmentation fault when properties exceed ~100kb

Đang mở
#223 6 bình luận 0 reaction 0 người được giao 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ả

Hi everyone, i'm running an event driven app and i use apache pulsar as backbone. I use message's properties to exchange metadata between the services.

I noted that, when the properties exceed ~100kb the client gives `Segmentation fault (core dumped)` (sometimes `corrupted double-linked list` instead)
> I haven't done a proper test on the size, so take the size as a guideline

I was able to simulate the behaviour in a notebook:

```py
import pulsar
import sys
import json

# need to serialize to json nested object because client accepts properties only
# of type (self: _pulsar.MessageBuilder, arg0: str, arg1: str)
nested_dict = json.dumps({
"foo": "bar"
})

big_dict = {
f"key{i}": nested_dict for i in range(3000)
}

print(sys.getsizeof(big_dict)) # 103856

client = pulsar.Client('pulsar://localhost:6650')
producer = client.create_producer('test-topic')

producer.send(content="test-message".encode(), properties=big_dict) # segfault
```

Unfortunately i don't have details in the stacktrace:

```
In [4]: producer.send(content="test-message".encode(), properties=big_dict)
Segmentation fault (core dumped)
```

Pulsar client version is 3.5.0.

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.