Commit c2884e5
mtlyzhang
[ISSUE #10256] Fix shared mutable batchAckIndexList causing toStoreBits update failure in PopBufferMergeService
When enablePopBatchAck and appendAckAsync are both enabled, scan() passes
a class-level shared batchAckIndexList to the async putBatchAckToStore(),
then immediately clears the list in the finally block. The async callback
captures the same (now-empty) list reference, causing toStoreBits to never
be updated. This prevents checkpoint wrappers from being removed from the
unbounded commitOffsets queue, leading to memory leak and potential OOM.
Fix: pass a defensive copy new ArrayList<>(indexList) so the async callback
captures an independent snapshot of the index data.
Made-with: Cursor1 parent 9879968 commit c2884e5
File tree
2 files changed
+48
-1
lines changed- broker/src
- main/java/org/apache/rocketmq/broker/processor
- test/java/org/apache/rocketmq/broker/processor
2 files changed
+48
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
237 | 284 | | |
0 commit comments