BUG,consumer.rs:872:29 attempt to subtract with overflow,
zhengxingjian opened this issue · 3 comments
zhengxingjian commented
`
self.remaining_messages -= message
.payload
.as_ref()
.and_then(|payload| {
println!("len {} {:?}",self.remaining_messages,payload.metadata.num_messages_in_batch);
payload.metadata.num_messages_in_batch
})
.unwrap_or(1i32)
as u32;
`
When a large number of messages are consumed, they can be reproduced by sending tens of thousands of messages in a few seconds, and the log outputs data:len 610 Some(1000),610-1000 as u32 overflow
DonghunLouisLee commented
@zhengxingjian Could you explain in detail how to reproduce this issue?
zhengcan commented
If the batch_size
used by producer is not smaller than the batch_size
in consumer, the lib might panic in above position.
For example:
- send in
10
, receive in1000
=> it works. - send in
1000
, receive in100
=> boom!
zhengcan commented
Please ref the test project:
https://github.com/zhengcan/pulsar-rs-issue-194