GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — [fix] [client] chunked message uuid-queue never removes entries on successful processing by programmerahul · Pull Request #26658 · apache/pulsar Conversation
|
|
@lhotari Please review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The larger issue with this is that , after processing of first chunked message, the expiry mechanism removeExpireIncompleteChunkedMessages() can't work for any incomplete message, because the logic will always find the first uuid from blockingQueue, but not in the chunkedMessageMap. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@poorbarcode @void-ptr974 @merlimat @codelipenghui @BewareMyPower @Demogorgon314 please review this PR. This is easily reproducible bug, and as a side-effect of it, the expiry mechanism doesn't work |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I have added a testcase for this scenario |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tracking this down and for including the follow-on observation about expiry.
The bug is real and the fix is correct for the normal completion path: ConsumerImpl.java:1548 now drops the completed uuid from pendingChunkedMessageUuidQueue. I removed that line locally and both new tests fail (queue stays at 50 entries; the incomplete "stuck" context is never expired), and with it they pass. GrowableArrayBlockingQueue.remove(Object) takes both queue locks so it is safe against the expiry thread, and the O(n) scan is bounded by the number of in-flight chunked messages, so I am not concerned about cost.
One point I would like addressed or discussed: this fixes one way a completed/discarded uuid can be left at the head of the queue, but removeExpireIncompleteChunkedMessages still returns on the first uuid whose context is gone (ConsumerImpl.java:3207-3216), so any other path that leaves a stale uuid behind reintroduces the exact symptom described in the PR. See the inline comment for the two paths I confirmed. Making the expiry loop drop stale heads and continue would address the whole class, and the two small cases could be covered by tests.
Minor: the PR description says the test is added but does not mention the expiry effect that the second test covers; worth adding to the Motivation.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @Denovo1998 for reviewing and approving the PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. The expiry loop now skips a stale head and the new tests cover both cases I raised. One small thing to fix in the loop: it should remove the uuid it looked at, not whatever is at the head. See the inline comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The completion-path cleanup fixes the reported UUID leak, and skipping stale heads is the right direction. However, the new poll() in the stale-head branch can remove an unrelated live UUID during concurrent completion. I independently reproduced the race already noted by @lhotari and would like it fixed before merging.
Validation on 7298171, using focused Gradle tests on Java 21 with retries disabled:
chunkedMessagesMap, but its UUID had disappeared from the queue.poll() with remove(messageUUID) made that reproducer and all three PR tests pass.Please include a deterministic regression for this interleaving. A non-head completion case (A0, B0, B1, leaving A incomplete) would also strengthen coverage. The full suite was not run, and all temporary source changes were restored.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I have addressed the comments: @lhotari @codelipenghui Please review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The previous production race is addressed. The new race regression passes at 613493d and fails as expected when the old poll() is restored. One test-only buffer cleanup issue remains below.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Both previous findings are addressed at 9b851b3: UUID-specific removal fixes the stale-head race, and the regression test now explicitly expires B, verifies its buffer is released, and cleans up remaining buffers on failure paths.
All 23 chunking test cases passed with retries disabled and -PtestExitJvmOnLeak=true, with no Netty leak diagnostics. The full repository suite was not run.
No actionable findings identified within the reviewed scope.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The expiry loop now removes the uuid it inspected, so it can no longer drop a live entry that the receive thread did not touch. The two new tests cover the race and the non-head completion case.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@programmerahul Checkstyle fails. Please run |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks, I have now fixed the checkstyle. Also all CI passed in my personal repo pr: programmerahul#2 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ccessful processing (#26658) Co-authored-by: Rahul Prasad <[email protected]> (cherry picked from commit b625a9f)
…ccessful processing (#26658) Co-authored-by: Rahul Prasad <[email protected]> (cherry picked from commit b625a9f)
…ccessful processing (apache#26658) Co-authored-by: Rahul Prasad <[email protected]> (cherry picked from commit b625a9f)
…ccessful processing (apache#26658) Co-authored-by: Rahul Prasad <[email protected]> (cherry picked from commit b625a9f)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug] chunked message uuid-queue never removes entries on successful processing
There was an error while loading. Please reload this page.