apache / apache/pulsar-client-go
[BUG] The capacity of dataChan is too big
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
Hi community. I noticed that the capacity of dataChan is too big. We make the `dataChan` with capacity `MaxPendingMessages` and the account of pending messages actual in queue may exceed the limit by `MaxPendingMessages` a lot.
This is because we use `publishSemaphore` instead of capacity of `dataChan` to limit pending messages. The actual limit is 2X of `MaxPendingMessages`.
https://github.com/apache/pulsar-client-go/blob/9867c29ca329302e97ddd9c6a99f66853c7f447f/pulsar/producer_partition.go#L148
Contributor guide
Research direction
Start in pulsar/producer_partition.go around line 148, then trace how dataChan and publishSemaphore limit pending messages. Confirm the intended fix from the issue and verify that queued pending messages stay within MaxPendingMessages rather than exceeding it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems, stream-processing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100