apache / apache/pulsar-client-go
ReconsumeLater cause panic
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
#### Expected behavior
should be `ReconsumeLater`
#### Actual behavior
Panic when call ReconsumeLater
With version 0.6.0
https://github.com/apache/pulsar-client-go/blob/fe3b7c4e445b3de42974ca692574229ad9099a45/pulsar/consumer_impl.go?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L481
same panic for 0.7
```
github.com/apache/pulsar-client-go@v0.7.0-candidate-1.0.20211108044248-fe3b7c4e445b/pulsar/consumer_impl.go:481 +0x6ca
```
#### Steps to reproduce
```
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: addr,
})
if err != nil {
panic(err)
}
consumer, err := client.Subscribe(pulsar.ConsumerOptions{
Topic: "test",
SubscriptionName: "xyz",
})
if err != nil {
panic(err)
}
for {
select {
case cm := <-consumer.Chan():
fmt.Println(string(cm.Payload()))
cm.ReconsumeLater(cm.Message,time.Second)
}
}
```
#### System configuration
**Pulsar version**: 0.6.0
Contributor guide
Research direction
Start with pulsar/consumer_impl.go around line 481 and reproduce the panic using the provided Subscribe and ReconsumeLater example against Pulsar 0.6.0 or the referenced 0.7 build. Trace the ReconsumeLater call from the consumer message path; done means the example returns or schedules ReconsumeLater without panicking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100