[fix][broker] Fix calculate avg message per entry - #17046
Conversation
| // Note | ||
| // Must ensure that the message is written to the pendingAcks before sent is first, | ||
| // because this consumer is possible to disconnect at this time. | ||
| if (pendingAcks != null) { |
There was a problem hiding this comment.
Why move pendingAcks here ?
There was a problem hiding this comment.
Make sure the loop is executed.
21e1859 to
bfbfc3d
Compare
gaoran10
left a comment
There was a problem hiding this comment.
LGTM, but I'm not sure why the entry could be null. Do you know the reason?
Because some entries were set to |
codelipenghui
left a comment
There was a problem hiding this comment.
@coderzc The change looks good. Could you please help add a test? to avoid the regression in the future.
41efd83 to
bfbfc3d
Compare
ok, I have already added a test. |
eolivelli
left a comment
There was a problem hiding this comment.
Lgtm
Good catch!
Please cherry pick to 2.10 branch
|
I don't think we need this in 2.9, filters don't exist there |
We need to cherry pick to 2.9 and 2.8, the same issue in |
|
Hi, @coderzc |
Yes, I will push a PR to branch-2.9. |
(cherry picked from commit 2c2b75e)
(cherry picked from commit 2c2b75e)
|
Remove from release 2.8.5. Since the original code is introduced in 2.9.3.#14666 |
Motivation
Calculating avg message per entry using
entries.size()is incorrect, because the entries may havenullvalues.Modifications
Calculate avg message per entry using the number of filter-out Non-null value total entries.
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)