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

Fixed buffer resize when writing request on connection #374

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Oct 1, 2020

Motivation

There is a problem when writing large commands on the connections (other than commands with payloads which are already handled correctly).

If the connection buffer doesn't have enough space, we're getting a panic for buffer overflow.

This can for example happen when triggering a lot of Nack() requests.

INFO[19:10:38.794] Stats - Consume rate:  770.4 msg/s -    6.0 Mbps
INFO[19:10:42.128] Connection closed                             local_addr="192.168.1.3:61179" remote_addr="pulsar://192.168.1.3:6651"
panic: runtime error: slice bounds out of range [:31678] with capacity 4088

goroutine 68 [running]:
github.com/apache/pulsar-client-go/pulsar/internal.(*connection).writeCommand(0xc00022e360, 0xc00055b6c0)
	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:461 +0x350
github.com/apache/pulsar-client-go/pulsar/internal.(*connection).internalSendRequest(...)
	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:562
github.com/apache/pulsar-client-go/pulsar/internal.(*connection).run(0xc00022e360)
	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:375 +0x20e
github.com/apache/pulsar-client-go/pulsar/internal.(*connection).start.func1(0xc00022e360)
	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:231 +0x71
created by github.com/apache/pulsar-client-go/pulsar/internal.(*connection).start
	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:227 +0x3f
exit status 2

@merlimat merlimat added this to the 0.3.0 milestone Oct 1, 2020
@merlimat merlimat self-assigned this Oct 1, 2020
merlimat added a commit to merlimat/pulsar-client-go that referenced this pull request Oct 1, 2020
@srkukarni srkukarni merged commit 7dd67c9 into apache:master Oct 1, 2020
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
…in-go#246) (apache#374)

Add command topic Delayed Delivery Policies:

- pulsarctl topics get-delayed-delivery [topic]
- pulsarctl topics set-delayed-delivery [topic] -t 22s -e
- pulsarctl topics remove-delayed-delivery [topic]
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
) (apache#374)

Add command topic Delayed Delivery Policies:

- pulsarctl topics get-delayed-delivery [topic]
- pulsarctl topics set-delayed-delivery [topic] -t 22s -e
- pulsarctl topics remove-delayed-delivery [topic]
tisonkun pushed a commit that referenced this pull request Aug 16, 2023
) (#374)

Add command topic Delayed Delivery Policies:

- pulsarctl topics get-delayed-delivery [topic]
- pulsarctl topics set-delayed-delivery [topic] -t 22s -e
- pulsarctl topics remove-delayed-delivery [topic]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants